mIRC Home    About    Download    Register    News    Help

Print Thread
Twitch recent follower #243282 04/11/13 01:20 AM
Joined: Oct 2013
Posts: 10
S
Skullmonkey Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Oct 2013
Posts: 10
Is there a way to show in chat when someone follows?

Re: Twitch recent follower [Re: Skullmonkey] #243284 04/11/13 02:20 AM
Joined: Jan 2004
Posts: 1,282
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,282
mIRC's sole purpose is not to work with Twitch, and however Twitch works in general is not mIRC related. If you had a question about their website, would you ask the Chrome or Firefox community and expect them to know what you were talking about?

Re: Twitch recent follower [Re: Loki12583] #243285 04/11/13 03:20 AM
Joined: Oct 2013
Posts: 10
S
Skullmonkey Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Oct 2013
Posts: 10
That first sentence made no sense at all. I could go on about how you are partially wrong, but I will save my keyboard.

I asked this because I know people have had new followers (yes, followers, not subcribers) displayed in their stream chat. They may use other programs but I don't have the know how to do that unless it was web based but I don't know how to connect to IRC over the web and have not had time to look it up.

Re: Twitch recent follower [Re: Skullmonkey] #243286 04/11/13 04:09 AM
Joined: Jan 2004
Posts: 1,282
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,282
Followers and subscribers have no meaning in either IRC or mIRC.

Re: Twitch recent follower [Re: Loki12583] #243289 04/11/13 11:37 AM
Joined: Nov 2009
Posts: 295
P
pball Offline
Fjord artisan
Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
I would say loki might be getting tired of seeing all the different threads asking for twitch help, lol.

Seriously though you could explain a bit more if you want some help. Also learning to do it yourself wouldn't be bad and not that hard. What you really need to think about is how would you check for new followers? Any script would have to follow the same steps you do. So I'm guessing it would involve checking a profile webpage or something. When you figure out what actually needs to be done, you could for help to do that instead of being vague.


http://scripting.pball.win
My personal site with some scripts I've released.
Re: Twitch recent follower [Re: pball] #243291 04/11/13 04:39 PM
Joined: Jan 2004
Posts: 1,282
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,282
Out of the kindness of my heart I took it upon myself to look through the Twitch API, and I wrote a few lines that utilize it. This is a very basic starting point but hopefully after some reading you'll come back with some questions which are more related to mirc scripting itself, and not on how the Twitch API works. This is not the appropriate forum to ask about the API.

This seems to be a good starting point to familiarize yourself with the Twitch API: https://github.com/justintv/Twitch-API/blob/master/README.md

Responses will be in json, so you may consider using this json script: http://www.mircscripts.org/comments.php?cid=4407

If you want finer control use sockets to receive and parse the data yourself: http://forums.mirc.com/ubbthreads.php/ubb/showflat/topic/45562/

You'll probably need a good handle on hash tables: /help hash tables in mIRC.

Code:
alias tw {
  var %url = https://api.twitch.tv/kraken/channels/PJS_Winning/follows
  
  if (!$hget(twitch)) { hmake twitch }
 
  var %_total = $json(%url,_total)
  var %user = $json(%url,follows,0,user,name)
  
  if (!$hget(twitch,_total)) || (%_total > $hget(twitch,_total)) {
    hadd twitch _total %_total
    hadd twitch %_total %user
  }
  
  echo -ag $hget(twitch,%_total)
}

Re: Twitch recent follower [Re: Loki12583] #243295 04/11/13 05:55 PM
Joined: Nov 2013
Posts: 7
G
Golden Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
G
Joined: Nov 2013
Posts: 7
I am starting to notice that Loki is awesome. I have been researching the API as well. laugh

Re: Twitch recent follower [Re: Loki12583] #243300 05/11/13 01:22 AM
Joined: Oct 2013
Posts: 10
S
Skullmonkey Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Oct 2013
Posts: 10
Since I am new to the whole IRC scripting, I don't know much. Thanks for the starting point. I should be able to get some things done.

Just for reference, what would the sequence be to display the latest follower?
Connect to API > Get a list of followers (limit to last one?) > Make it a var > Repeat every 10 secs or so > Check followers again and compare to the var > display text if changed

Would that generally be the way to go?

Re: Twitch recent follower [Re: Skullmonkey] #243302 05/11/13 07:46 AM
Joined: May 2013
Posts: 25
R
razezar Offline
Ameglian cow
Offline
Ameglian cow
R
Joined: May 2013
Posts: 25
Originally Posted By: Skullmonkey
Since I am new to the whole IRC scripting, I don't know much. Thanks for the starting point. I should be able to get some things done.

Just for reference, what would the sequence be to display the latest follower?
Connect to API > Get a list of followers (limit to last one?) > Make it a var > Repeat every 10 secs or so > Check followers again and compare to the var > display text if changed

Would that generally be the way to go?


Basically.
You wouldn't want to make the entire json response from twitch a variable since at some point you're going to have to parse it anyways (and it will be a mighty bulky variable). Furthermore, I wouldn't spam their (or any) api every 10 seconds either, I'd make use of the 'etag' and 'last-modified' headers or poll it at most once every 5 to 10 minutes.

Last edited by razezar; 05/11/13 07:46 AM.
Re: Twitch recent follower [Re: razezar] #243304 06/11/13 08:09 AM
Joined: Nov 2013
Posts: 7
G
Golden Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
G
Joined: Nov 2013
Posts: 7
I, for the life of me, can not figure out how to do this...

Re: Twitch recent follower [Re: Loki12583] #246287 01/06/14 08:45 PM
Joined: May 2014
Posts: 16
R
radmux Offline
Pikka bird
Offline
Pikka bird
R
Joined: May 2014
Posts: 16
Originally Posted By: Loki12583


This seems to be a good starting point to familiarize yourself with the Twitch API: https://github.com/justintv/Twitch-API/blob/master/README.md



Some good information here. I recently sought help in creating a raffle script for my stream channel. Now, I'd like to add a check in my raffle script to see if the user is a follower on my twitch channel.

Re: Twitch recent follower [Re: Loki12583] #246289 01/06/14 10:16 PM
Joined: May 2014
Posts: 16
R
radmux Offline
Pikka bird
Offline
Pikka bird
R
Joined: May 2014
Posts: 16
Originally Posted By: Loki12583

Responses will be in json, so you may consider using this json script: http://www.mircscripts.org/comments.php?cid=4407

If you want finer control use sockets to receive and parse the data yourself: http://forums.mirc.com/ubbthreads.php/ubb/showflat/topic/45562/


Do I just add the json snippet to the rest of my script? I've read through the API and stuff but I don't understand most of the code. How can I check to see if, for instant, the user/$nick giving the command on my channel is a follower or not?