mIRC Homepage
Posted By: synth7 how to get into from a webpage - 16/02/07 08:55 PM
I've read about sockets as much as I could but it's simply not clicking with me. Any help or a point in the right direction would be very helpful, it might help so see some actual code that does something similiar so I can figure out how to do this

What i want to do with a script is to go to this page - http://www.wrfx.com/iplaylist/ - and get the current song title and artist into a channel.

any info is appreciated, thanks
Posted By: Riamus2 Re: how to get into from a webpage - 16/02/07 09:43 PM
If you search the forum for "sockopen", you'll find various examples of how to work with sockets.

Basically, you need to open the socket using /sockopen. Then, you need an on SOCKOPEN event. These usually look the same no matter what site you're working with other than the GET line and the HOST line. Finally, you need the on SOCKREAD event that will parse your text. Remember that text is read 1 line at a time from the HTML code, so you need to check each line for the text you're trying to get and, when you find it, do whatever you want to with it.
© mIRC Discussion Forums