I was wondering about that, but I have already tried with and without the sockname added. Still seems to hang on socket open. Before anyone asks, yes, I am testing with the ID and API key added in.

If you are getting a response, I must have done something else wrong.

This is my current code:
Code:
alias youtube {
  sockopen -e ytube www.googleapis.com 443
  echo -tag socket open
}

on *:sockopen:ytube:{
  echo -tag begin socket write
  if ($sockerr) { 
    echo -tag socket error
    sockclose $sockname
    halt 
  }
  
  sockwrite -n $sockname GET /youtube/v3/playlistItems?part=id&playlistId=<id here>&key=<api here> HTTP/1.1
  sockwrite -n $sockname Host: www.googleapis.com 
  sockwrite -n $sockname $crlf

  echo -tag socket write
}

on *:sockread:ytube:{
  if ($sockerr) { return }
  var %read | sockread -f %read
  while ($sockbr) {
    if (%read != $null) echo -ag %read
    sockread -f %read
    echo -tag socket reading
  }

  ;  var $youtubedata
  ;  sockread $youtubedata

  echo -tag socket read
}

Last edited by AeonPsych; 24/07/14 03:25 AM. Reason: added code