Sockets
Posted by Ghost
Saturday, May 15, 2004
Description:
alias TKOforum {
sockopen TKOforum tkolegacy.org 80
}
on *:sockopen:TKOforum:{
sockwrite -n TKOforum GET /forums/ HTTP/1.1
; This is telling the socket to connect to the specific page, using "GET".
sockwrite -n $sockname Host: tkolegacy.org $+ $crlf $+ $crlf
; This states the host once again.
}
on *:sockread:TKOforum:{
if ($sockerr) {
echo -a Error.
halt
}
else {
var %temptext
sockread %temptext
if (<span class="gensmall">Our users have posted a total of * articles<br />We have
* registered users<br />The newest registered user is <a href="profile.php?mode=
viewprofile&u=129">*</a></span> iswm %temptext) {
echo -a -
echo -a $htmlfree(%temptext)
}
}
}
alias -l htmlfree {
; It's local because it won't be used by the command line, only this file.
; Local aliases avoid conflicting names.
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}
alias TKOforum {
sockopen TKOforum tkolegacy.org 80
}
on *:sockopen:TKOforum:{
sockwrite -n TKOforum GET /forums/ HTTP/1.1
; This is telling the socket to connect to the specific page, using "GET".
sockwrite -n $sockname Host: tkolegacy.org $+ $crlf $+ $crlf
; This states the host once again.
}
on *:sockread:TKOforum:{
if ($sockerr) {
echo -a Error.
halt
}
else {
var %temptext
sockread %temptext
if (<span class="gensmall">Our users have posted a total of * articles<br />We have
* registered users<br />The newest registered user is <a href="profile.php?mode=
viewprofile&u=129">*</a></span> iswm %temptext) {
echo -a -
echo -a $htmlfree(%temptext)
}
}
}
alias -l htmlfree {
; It's local because it won't be used by the command line, only this file.
; Local aliases avoid conflicting names.
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}