mIRC Home    About    Download    Register    News    Help

Print Thread
#251453 19/02/15 04:13 AM
Joined: Dec 2014
Posts: 40
Feyl0rd Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2014
Posts: 40
Is there a way to pull information for a website and have it read out into a channel?
Example

I'm going for a on text for sites like this.

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Dec 2014
Posts: 40
Feyl0rd Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2014
Posts: 40
Read it over, feel enlightened on IPv4 and 6 and the difference between stream and datagram sockets but none-the-wiser on what I'm after. frown

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
At the bottom of the page I sent you, there are two re-directional links to UDP and TCP sockets. Read that section and choose which one you want to use.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Dec 2014
Posts: 40
Feyl0rd Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2014
Posts: 40
Ooooh I see. I assumed the information would just be apart of the page itself. I'll read this over as well!

Joined: Dec 2014
Posts: 40
Feyl0rd Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2014
Posts: 40
More difficult to wrap my head around than I had anticipated.

Joined: Dec 2014
Posts: 40
Feyl0rd Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2014
Posts: 40
No luck. I either get an error or nothing happens.
I figured it would be simple because it's just one little line. I deleted my code and will try again. frown

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
That site was part of a popular request long ago that I made a script for. It works and you can use it as a guideline for coding socket scripts. You can find it here.

However, since recent, there's been a popular JSON parser made by Froggie, another forum user, which will allow you to very easily pull that info straight from the TwitchAPI. You can use the search function to find more info regarding this. I believe searching for "JSON" or "UPTIME" should work.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
using the script from my signature to get the first 5 followers of a channel quite easily:

Code:
var %stream = night
JSONOpen -ud followers https://api.twitch.tv/kraken/channels/ $+ %stream $+ /follows/?limit=5
var %x = 0, %followers
while (%x < $JSON(followers, follows, length)) {
  %followers = %followers $json(followers, follows, %x, user, name)
  inc %x
}
; %followers contains the first 5 followers


Last edited by FroggieDaFrog; 21/02/15 10:59 AM.

I am SReject
My Stuff
Joined: Dec 2014
Posts: 40
Feyl0rd Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2014
Posts: 40
The script in your signature looks next level. Hurts my head xD. I'll give it a look, thanks for posting!

Joined: Dec 2014
Posts: 40
Feyl0rd Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2014
Posts: 40
I finally got it to work but when I call for %followers it spits out the following:
msg1: Follower1
msg2: Follower1 Follower2
msg3: Follower1 Follower2 Follower3
msg4: Follower1 Follower2 Follower3 Follower4
msg5: Follower1 Follower2 Follower3 Follower4 Follower5

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Put your "msg #" event after (outside) the while loop.
%Followers will be set to add a follower for each time, when the loop finishes, %Followers will have all the info you need. If you have the msg # inside the while loop you will msg the channel for each time the loop goes on.

/help while loops


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Dec 2014
Posts: 40
Feyl0rd Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2014
Posts: 40
That makes a lot of sense!
Worked like a charm. Gonna have to put in more study into calling certain things from a website with the JSON stuff.

Thank you both for your help.
<3 <3 <3

Last edited by Feyl0rd; 26/02/15 08:08 AM.
Joined: Dec 2014
Posts: 40
Feyl0rd Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2014
Posts: 40
Hey I messaged you about your JSON script.


Link Copied to Clipboard