Posted 07 November 2015 - 12:51 AM
Have you ever wanted to know when a certain streamer is live, but you don't want to leave the game? Perhaps you want a quick easy way to see your latest follower? Maybe you want to see your viewer or follower count? You probably want a computerized solution to this problem, yeah? Want to make it easier on yourself with an API? Well, here is what you have been looking for all along!
The basic gist of how this works: It uses the JSON api (found here though it auto-downloads) by the talented ElvishJerricco
It asks the twitch API servers for a streamer's stream (or follows) element you specify (see usage below) and then spits out information regarding the function you choose. I highly recommend having a second or so sleep every four or so times you 'ping' Twitch, otherwise you may get temporarily banned from the Twitch api ;)/>
USAGE:
DOWNLOADS:
API: pastebin get vh4Jd1B6 twitchapi
EXAMPLE: pastebin get BkR9un49 example
NEW! My friend, Funniray, has slightly edited the API for beam.pro use!
pastebin get wbPC0Zv7 beamapi
Kd's Twitch Interface-API
The basic gist of how this works: It uses the JSON api (found here though it auto-downloads) by the talented ElvishJerricco
It asks the twitch API servers for a streamer's stream (or follows) element you specify (see usage below) and then spits out information regarding the function you choose. I highly recommend having a second or so sleep every four or so times you 'ping' Twitch, otherwise you may get temporarily banned from the Twitch api ;)/>
USAGE:
os.loadAPI("twitchapi")
twitchapi.live("wolftaz",colors.green,colors.red) -- argumets: streamer name, live color, NOT live color
OR…
os.loadAPI("twitchapi")
if twitchapi.checkLive("choobtastic") then
print("Live!")
else
print("Not live!")
end
OR…
os.loadAPI("twitchapi")
print(twitchapi.lastFollower("rebelofroses")
OR…
os.loadAPI("twitchapi")
print(twitchapi.followerCount("EthanRay10"))
OR…
os.loadAPI("twitchapi")
print(twitchapi.viewerCount("kd8lvt"))
OR…
os.loadAPI("twitchapi")
print(twitchapi.viewCount("leavaris")) --This only works when the stream is LIVE! Additionally, View count it DIFFERENT from current VIEWERS! This is how many times the stream page has been loaded!
If you want, here is the code so you can suggest improvements:Spoiler
Look at the pastebin, its got the most up to date version!API: pastebin get vh4Jd1B6 twitchapi
EXAMPLE: pastebin get BkR9un49 example
NEW! My friend, Funniray, has slightly edited the API for beam.pro use!
pastebin get wbPC0Zv7 beamapi
Edited on 04 January 2016 - 02:13 PM