using a socket would be better
here is a fast mock up...
on $*:text:/^@HPlines$/iS:#: {
if (!$hget(HP,C)) {
if ($sock(HPlines)) sockclose HPlines
sockopen HPlines www.pickuplinesgalore.com 80
sockmark HPlines $r(1,28) msg # Harry Potter pick up line
}
}
on *:sockopen:HPlines: {
sockwrite -nt $sockname GET /harrypotter.html HTTP/1.1
sockwrite -nt $sockname Host: $+(www.pickuplinesgalore.com,$str($crlf,2))
}
on *:sockread:HPlines: {
var %HPlines | sockread %HPlines
if ($regex(%HPlines,/<td><span class=.+>(.+)<\/span><\/td>/)) {
hinc -mu5 HP C 1
if ($hget(HP,C) = $gettok($sock(HPlines).mark,1,32)) {
$gettok($sock(HPlines).mark,2-,32) $+($chr(35),$v1,:) $&
$replace($regml(1),",")
sockclose HPlines
}
}
}