!!Fixed!!
Just a zip code look up socket i made for fun.
Copy/paste into a new remote.
trigger is:. @zip ex: @zip 90210
on $*:text:/@zip\s(\d{5})/iS:#: {
if (!$hget(zip,1)) {
if ($sock(zip)) sockclose zip
sockopen zip www.melissadata.com 80
sockmark zip $+(/lookups/ZipCityPhone.asp?InData=,$regml(1)) msg #
}
}
on *:sockopen:zip: {
sockwrite -nt $sockname GET $gettok($sock(zip).mark,1,32) HTTP/1.1
sockwrite -nt $sockname Host: $+($sock(zip).addr,$str($crlf,2))
}
on *:load: {
echo 04 -a You Have Just Loaded Napa182's Zip Code Look Up.
echo 07 -a An irc.EzzyChat.com Production
}
on *:sockread:zip: {
var %zip | sockread %zip
if ($regex(%zip,/<\/b>( was not found.)<\/div>/)) {
$gettok($sock(zip).mark,2-,32) Zip Code $regml(1)
sockclose zip
}
if ($regex(%zip,/State<\/.+>(.+)<\/b>/)) { hadd -mu4 zip 1 State: $regml(1) }
if ($regex(%zip,/City Name<\/.+>(.+)<\/b>/)) {
$gettok($sock(zip).mark,2-,32) $hget(zip,1) City: $regml(1)
sockclose zip
}
}