mIRC Home    About    Download    Register    News    Help

Print Thread
#256262 01/01/16 09:04 PM
Joined: Apr 2015
Posts: 42
A
Artiiz Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Apr 2015
Posts: 42
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

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
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

Joined: Apr 2015
Posts: 42
A
Artiiz Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Apr 2015
Posts: 42
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