mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
I was wondering how to make commands such as !created (to show user how long their twitch account was made for) and !following (show how long they've been following the channel) but I'm so confused on how to use Twitch's apis to start making these commands....any help? smile

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Have a look into this add-on maybe is that you want.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
Confused on how this is related to twitch apis....?

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Check the description and the code then look what you wrote and compare the relationship between them.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jun 2015
Posts: 84
F
Babel fish
Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
I learned that using this JSON Viewer can help figure out the format structure of how you need to work inside of JSON to get to where you need.

For example:
Code:
alias streamGame {
  var %j = followUser
  JSONOpen -ud %j https://api.twitch.tv/kraken/channels/ $+ $1 $+ ?= $+ $ticks
  var %streamGame = $json(%j,game)
  return %streamGame
}

(Note: This is to find the game of a channel.)

But sit down and just read through the API code if possible.

It's easiest to just use the http://api.twitch.tv/kraken/channels/CHANNEL/
Look for the created_at: DATE and you'll be able to find it then.
Just do a $replace($json(%j,created_at),T,$chr(32),Z,)) and it'll look like 2012-01-20 23:15:15.

Following would be better to check out westor's code, and since he already has that under the !followed NICK section.

As always, using /help <item> can return a few things as well.


Link Copied to Clipboard