mIRC Homepage
Posted By: wobY [Twitch] Sockets/API help - 19/01/17 01:04 PM
Is there any really good in-depth sockets tutorials on YouTube or in a written step-by-step pdf file? I've been reading the written one by the dev of mIRC but I just don't get it smirk Sockets are completely new thing to me and I learn faster by watching video so it would be awesome if there's a tutorial on YouTube. I'm trying to use the decapi for things like uptime and the latest tweet and youtube vid.

What I currently have(Not sure if its correct. This is all I know about sockets):
Code:
alias uptime {
  sockopen -e uptime decapi.me 443
}

on *:SOCKOPEN:uptime: {
  sockwrite -nt $sockname GET $+(/twitch/uptime.php?channel=woby_tv) HTTP/1.1
  sockwrite -nt $sockname Host: decapi.me
  sockwrite $sockname $crlf
}
Posted By: Wims Re: [Twitch] Sockets/API help - 19/01/17 01:43 PM
https://en.wikichip.org/wiki/mirc/sockets

Wikichip/mirc/ handles all mIRC Scripting topics except binary variables.
Posted By: FroggieDaFrog Re: [Twitch] Sockets/API help - 19/01/17 03:41 PM
If you are intention is to hit the Twitch API, you can use My JSON Parser to easily make requests and retrieve data out of the response.

I also have a few scripts to make dealing with twitch a bit easier called mTwitch(they depend on the json parser above). With mTwitch.Core.mrc and mTwitch.StateToTopic.mrc there are custom events raised through signal to indicate things like stream online/offline:

Code:
on *:SIGNAL:mTwitch.StreamOnline:{
  echo -a $1 is online
}

on *:SIGNAL:mTwitch.StreamOffline:{
  echo -a $1 is offline
}
© mIRC Discussion Forums