rendered paste bodyon *:TEXT:*:#: {
if (http:// isin $1) {
var %host, %get
%host = $remove($1,http://)
;;if URL is top page of site, creates random char for sockname
if ($gettok(%host,2-,47) == $null) { %get = $chr(146) }
else { %get = $gettok(%host,2-,47) }
%host = $gettok(%host,1,47)
set %sock.ch #
if (www != $left(%host,3)) { %host = www. $+ %host }
set %sock.host %host
sockopen %get %host 80
}
}
on *:sockopen:*: {
msg %sock.ch sockwrite -n $sockname GET / $+ $sockname HTTP/1.1
if ($chr(146) == $sockname) { sockwrite -n $sockname GET / HTTP/1.1 }
else { sockwrite -n $sockname GET / $+ $sockname HTTP/1.1 }
sockwrite -n $sockname Host: %sock.host
sockwrite -n $sockname Connection: Close
sockwrite -n $sockname $crlf
}
on *:sockread:*:{
sockread %sock
var %title
if (*<title>*</title>* iswm %sock) {
;msg %sock.ch $remove(%sock,<title>,</title>)
%title = $remove(%sock,<title>,</title>,$chr(9))
msg %sock.ch %title
}
}