based off your code this is what I have so far:
on @*:text:!song*:#:{
if ($2 != $null) {
song # $2-
}
}
alias song {
var %videoid = $gettok($2-,1,35)
%videoid = $gettok(%videoid ,2-,61)
var %chan = #$$1, %song = $2-
var %sockname = song. $+ $ticks
hfree -w %sockname | .hmake %sockname
hadd %sockname request /feeds/api/videos/ $+ videoid
if (%song != $null) {
msg # %videoid
hadd %sockname method GET
hadd %sockname signal song.get
}
sockopen -e %sockname gdata.youtube.com 443
}
on *:signal:song.get:{
var %err = $1, %sockname = $2, %header = $3, %data = $4
if (* 200 OK iswm $read(%header,n,1)) msg Good Status: $json(%data,status)
else msg Bad Could not get status.
hfree -w %sockname
if ($isfile(%header)) .remove %header
if ($isfile(%data)) .remove %data
}
Yet the code never gets to song.get
I don't even know if I am doing this right. This socket stuff is way beyond me, and the tutorials people have mentioned don't help me personally for 2 reasons:
1. I am not creating this code for anyone else. As such, I don't care if it looks ugly. I just want it to get the job done.
2. I have yet to find a tutorial that explains in layman's terms what happens at every point of code. If what I want could be explained at every step in pseudo code, it would help me understand sockets much better.