Here's a very basic example.

Code:
alias opensocket {
  sockopen socketname www.host.com 80
}

on *:sockopen:socketname: {
  sockwrite -n $sockname GET /path/filename.html HTTP/1.0
  sockwrite -n $sockname Host: www.host.com $+ $crlf $+ $crlf
}

on *:sockread:socketname: {
    if ($sockerr) {
    echo -a Error.
    halt
  }
  else {
    var %temptext
    sockread %temptext
    if (sometext isin %temptext) { echo -a %temptext }
    elseif (some*text* iswm %temptext) { set %var $gettok(%temptext,1,32) }
  }
}


You'll need to replace the "socketname" (unless you want it called that) in all 3 location. You also have to replace both website hosts and the path\filename.html. You may also want to change the alias name to suit your needs. Finally, you can adjust the IF/ELSEIF section to suit your needs. I just gave a couple examples of what can go there. Normally, you're not looking to output everything on a page, so you need to parse it using IF checks and then you either output it or put it into variables to be used later in some way.

There are other things that can be used in the SOCKOPEN event and may even be necessary depending on the site you're using. In general, this should do what you need.

If you just want an output of the HTML source to make sure you're getting what you should be getting, you can remove the IF/ELSEIF lines and instead insert echo @SocketTest %temptext instead. (Make sure you create that window before trying the socket by using /window -n @SocketTest ).

To test afterwards, just call the alias.


Invision Support
#Invision on irc.irchighway.net