mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2014
Posts: 9
L
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Feb 2014
Posts: 9
I am attempting to write a !latestfollowers command and everything is going fine but I am having problems with reading "display_name" I am using the $json script by Timi so I use the syntax $json(WWWPAGE, "display_name") and it returns the first instance. I was wondering if there was a way to read multiple "display_name" instances. Here is a page example of what I am trying to read from:
https://api.twitch.tv/kraken/channels/twitchplayspokemon/follows?limit=10&offset=0

Ty for your help.

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
$json(%url,display_name) does not access the first instance. The first instance is here: $json(%url, follows, 0, user, display_name)

You need to get the follows count and then loop over it.

Code:
var %i = 0, %count = $json(%url, follows).count
while (%i < %count) {
  echo -ag $json(%url, follows, %i, user, display_name)
  inc %i
}


Joined: Feb 2014
Posts: 9
L
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Feb 2014
Posts: 9
Just tested it and it works TY so much Loki smartest and nicest mIRC scripter out there!


Link Copied to Clipboard