Driving myself crazy with this one, i believe i understand how sockets work, albeit a very basic level.
I'm trying to read data from a site:
http://apis.rtainc.co/twitchbot/following.php?channel=randomchannel&user=randomuserI have the following code
alias followed {
sockclose followed
sockopen followed apis.rtainc.co 80
}
on *:SOCKOPEN:followed:{
if ($sockerr) { sockclose $sockname | halt }
sockwrite -nt $sockname GET /twitchbot/following.php?channel=randomviewer&user=randomuser HTTP/1.1
sockwrite -n $sockname Host: apis.rtainc.co
sockwrite $sockname $crlf
}
on *:SOCKREAD:followed:{
if ($sockerr) { sockclose $sockname }
var %data
sockread %data
echo %data
}
I should be echoing: randomuser is not following but i am only echoing raw headers.
Any thoughts? I'm using similar socket scripts already and can read data from a website just fine.
Thanks!