mIRC Home    About    Download    Register    News    Help

Print Thread
#256262 01/01/16 09:04 PM
A
Artiiz
Artiiz
A
Hello,

So, I was wondering if it's possible making a "Followage" script with Twitch API.

I want it to say how long I has followed a stream.
I'm using this Twitch's own api:
https://api.twitch.tv/kraken/users/artiiz/follows/channels/sodapoppin

I want it to say like "artiiz has been following channel 'target' for 0d, 00h, 00m and 00s."
Like this:


I tried using this script:
Code:
on 1:text:!followage:#artiiz:{
  msg $chan @ $+ $nick has been following channel sodapoppin for $url(http://api.twitch.tv/kraken/users/artiiz/follows/channels/sodapoppin)
}

But then it just says:

Is there a way of making it, and if there are, how? smile

#256263 02/01/16 02:17 AM
S
Sakana
Sakana
S
Yes, you need to use a JSON parser. Try this http://hawkee.com/snippet/10194/

It looks like you need to access the element called "created_at", which gives the value "2014-08-15T01:21:52+00:00"

Then you need to find a way to calculate the time difference between then and now. I think someone has already made a script for that

#256277 04/01/16 09:36 PM
A
Artiiz
Artiiz
A
Hey, sorry for late respond.

So I've made a script containing that JSON Script.
But the question is what should the script for mIRC be to make it work?


Link Copied to Clipboard