As an example, I've made you a very stupid little socket script that will display the amount of registered users on the mIRC Msgboard.
Note that I'm absolutely unexperienced with sockets, so there might be tweaks, and extra additions necessary. Nevertheless, it's a working example of how to achieve what you want.
Note that the parsing is very dependent on the way that the webpage is created, so for another webpage, the parsing will be different.
Note that right now I'm only using a regular variable (%data) and not a binvar to store the incoming data from the socket. In many occasions on different pages, the *string too long issue can arise when the read-in data exceeds the max string length possible. For our example, %data is fine though.
Usage: /showregistered
alias showregistered sockopen mirc mirc.com 80
[color:red] [/color]
on *:SOCKOPEN:mirc:{
var %sn = $sockname
if $sockerr { echo -a Error opening socket %sn | halt }
sockwrite -n %sn GET https://forums.mirc.com/ubbthreads.php HTTP/1.1
sockwrite -n %sn Host: mirc.com $+ $crlf $+ $crlf
echo -a Opened socket %sn
}
[color:red] [/color]
on *:SOCKREAD:mirc:{
var %sn = $sockname
if $sockerr { echo -s Error reading from socket %sn | halt }
var %data
sockread %data
if * Registered User(s). iswm %data {
echo -ac info * Found $gettok(%data,1,32) registered users on the mIRC Msgboard
sockclose %sn
halt
}
}
[color:red] [/color]
on *:SOCKCLOSE:mirc: echo -a Closed socket $sockname
Again, it's just an example.
Btw, the on sockclose event does not get triggered when you (or your script) tells the socket to close. So normally you won't see the "Closed socket mIRC". You will however see it if it closed out of its own.
Greets