alias updatetopic {
if ($me !isop $$1) { echo $color(info2) -at * Topic Update Error: You are not an op on $1 , halting topic update check. }
else {
var %s = $+(topicup.,$$1)
if ($sock(%s)) { sockclose %s }
;- set the site name:
hadd -m %s host trick-jumps.lv
;- Set the page you want to GET, using the
;- preceding forward slash '/' as shown below.
hadd -m %s get /mirc/news.php
hadd -m %s read $false
sockopen %s $hget(%s,host) 80
}
}
on *:sockopen:topicup.*: {
if ($sockerr) { echo $color(info2) -at * Socket Open ERROR: $sock(%s).wsmsg | return }
sockwrite -nt $sockname GET $hget($sockname,get) HTTP/1.1
sockwrite -nt $sockname Host: $hget($sockname,host)
sockwrite -nt $sockname Accept-Language: en-us
sockwrite -nt $sockname User-Agent: Mozilla/??
sockwrite -nt $sockname $+(Connection: close,$str($crlf,2))
}
on *:sockread:topicup.*: {
var %t, %s = $sockname, %c = $gettok(%s,2,46)
sockread -f %t
if ($sockerr) { echo $color(info2) -at * Socket Read ERROR: $sock(%s).wsmsg | return }
if (%t == $null) { hadd -m %s read $true }
if (($hget(%s,read)) && (%t != $null)) {
if ($chan(%c).topic != %t) { topic %c %t }
}
}