mIRC Home    About    Download    Register    News    Help

Print Thread
#251453 19/02/15 04:13 AM
F
Feyl0rd
Feyl0rd
F
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.

#251457 19/02/15 06:14 AM
Joined: Dec 2013
Posts: 771
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 771

F
Feyl0rd
Feyl0rd
F
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

#251460 19/02/15 06:33 AM
Joined: Dec 2013
Posts: 771
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 771
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.

F
Feyl0rd
Feyl0rd
F
Ooooh I see. I assumed the information would just be apart of the page itself. I'll read this over as well!

F
Feyl0rd
Feyl0rd
F
More difficult to wrap my head around than I had anticipated.

#251511 20/02/15 10:08 PM
F
Feyl0rd
Feyl0rd
F
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

#251522 21/02/15 04:53 AM
Joined: Dec 2013
Posts: 771
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 771
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.

#251525 21/02/15 10:58 AM
Joined: Apr 2010
Posts: 964
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 964
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.
F
Feyl0rd
Feyl0rd
F
The script in your signature looks next level. Hurts my head xD. I'll give it a look, thanks for posting!

F
Feyl0rd
Feyl0rd
F
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

#251633 26/02/15 07:53 AM
Joined: Dec 2013
Posts: 771
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 771
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

F
Feyl0rd
Feyl0rd
F
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.
F
Feyl0rd
Feyl0rd
F
Hey I messaged you about your JSON script.


Link Copied to Clipboard