mIRC Homepage
Posted By: Feyl0rd xml question or...? - 19/02/15 04:13 AM
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.
Posted By: Nillen Re: xml question or...? - 19/02/15 06:14 AM
Follow this tutorial:
http://en.wikichip.org/wiki/mirc/sockets
Posted By: Feyl0rd Re: xml question or...? - 19/02/15 06:31 AM
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
Posted By: Nillen Re: xml question or...? - 19/02/15 06:33 AM
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.
Posted By: Feyl0rd Re: xml question or...? - 19/02/15 06:35 AM
Ooooh I see. I assumed the information would just be apart of the page itself. I'll read this over as well!
Posted By: Feyl0rd Re: xml question or...? - 19/02/15 06:36 PM
More difficult to wrap my head around than I had anticipated.
Posted By: Feyl0rd Re: xml question or...? - 20/02/15 10:08 PM
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
Posted By: Nillen Re: xml question or...? - 21/02/15 04:53 AM
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.
Posted By: FroggieDaFrog Re: xml question or...? - 21/02/15 10:58 AM
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

Posted By: Feyl0rd Re: xml question or...? - 22/02/15 04:34 AM
The script in your signature looks next level. Hurts my head xD. I'll give it a look, thanks for posting!
Posted By: Feyl0rd Re: xml question or...? - 26/02/15 06:26 AM
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
Posted By: Nillen Re: xml question or...? - 26/02/15 07:53 AM
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
Posted By: Feyl0rd Re: xml question or...? - 26/02/15 08:04 AM
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
Posted By: Feyl0rd Re: xml question or...? - 11/03/15 08:12 PM
Hey I messaged you about your JSON script.
© mIRC Discussion Forums