mIRC Home    About    Download    Register    News    Help

Print Thread
#87935 23/06/04 10:06 PM
Joined: May 2004
Posts: 4
Z
zopha Offline OP
Self-satisified door
OP Offline
Self-satisified door
Z
Joined: May 2004
Posts: 4
I am new to mirc scripting, and definitely new to sockets. But are there any easy way to get the information from a webpage as text/output instead of html code plus http info?

I would be grateful if you would help me out here.

#87936 24/06/04 12:23 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Nope, sorry. If you want something from a web server, you'll have to send and receive http headers. However those are rather simple to make and remove from the output. Another way is using wget for example to download a file from a website without the hassle of scripting it in mIRC.

If the file you get from the web server is a regular text file you have what you wanted, if it's html you'll have to parse it yourself to remove all <tag> stuff.

You can also search google for something like 'remove html formatting'. One program i found (http://www.protonfx.com/) should remove all html tags in a file, it has commandline so you can /run it. (i haven't written or tested this program, but it seems to do what you want)

#87937 24/06/04 04:57 PM
Joined: Mar 2004
Posts: 457
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Mar 2004
Posts: 457
u can send the whole output thru this alias to remove all the HTML:

Code:
alias striphtml {
  var %x, %i = $regsub($1-,/(^[^&lt;]*&gt;|&lt;[^&gt;]*&gt;|&lt;[^&gt;]*$)/g,$null,%x), %x = $remove(%x,&amp;nbsp;)
  return %x
}

(Written by Jagfire not me so i thought i'd give him the credit)

Eg:
Code:
on *:sockread:[color:red]socketnamehere[/color]:{
  var %b
  sockread %b
  echo -s $striphtml(%b)
}


that will, or at least should output a page to your status window without any HTML in it.


Link Copied to Clipboard