mIRC Homepage
Posted By: SpaceBoy sockread - 30/12/03 10:03 PM
Hi

I have a webpage that I'm retrieving headlines from - unfortunatly the page seems to be too big to write to a txt file, so I'm trying to identify the line I need. The problem is that there is no html or other unique text around the headline - just blank space and even that is repeated numerous time above it. Is it possible to state a specific line number in the script for the sock to read from the webpage, similar to how you can in $read for a text file?
Thanks.
Posted By: KingTomato Re: sockread - 31/12/03 12:50 AM
Is it safe to assume the headline you're trying to gather is the red postion on the link in your signature?

If you're using sockets, use:

/sockread -f &data
/bwrite myfile.htm -1 -1 &data

that will write the complete contents of the webpage to myfile.htm. From there, use the on SOCKCLOSE event to read a specific line, then use /remove to remove the file when you're done! >:P
Posted By: SpaceBoy Re: sockread - 31/12/03 03:12 AM
Hi KT

The page I'm trying to get is:
http://keyinvest.ibb.ubs.com/ki/de/en/newstraderstalk/news.ki?newssectorid=ki_gn

The headline at the top of the Reuters news list...it's a tricky one as there is no html around it, so the only way I can think of is to have the whole page dumped to a file and then specify a line number to read to the channel !

Thanks!
Posted By: KingTomato Re: sockread - 31/12/03 04:25 AM
Do the method I told you for the sockread, then just read the lince number from the text file it creates on the sock close >:P
Posted By: SpaceBoy Re: sockread - 31/12/03 04:34 AM
just tried again - dosnt write all the page to the htm file - just the header stuff
confused
Posted By: SpaceBoy Re: sockread - 31/12/03 04:53 AM
got it going - was missing the goto nextread line

thanks KT smile
© mIRC Discussion Forums