mIRC Home    About    Download    Register    News    Help

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

Joined: Jan 2004
Posts: 1,360
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,360
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?

Joined: Oct 2013
Posts: 10
S
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.

Joined: Jan 2004
Posts: 1,360
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,360
Followers and subscribers have no meaning in either IRC or mIRC.

Joined: Nov 2009
Posts: 295
P
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.
Joined: Jan 2004
Posts: 1,360
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,360
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: https://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)
}

Joined: Nov 2013
Posts: 7
G
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

Joined: Oct 2013
Posts: 10
S
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?

Joined: May 2013
Posts: 25
R
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.
Joined: Nov 2013
Posts: 7
G
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...

Joined: May 2014
Posts: 16
R
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.

Joined: May 2014
Posts: 16
R
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: https://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?


Link Copied to Clipboard