alias weather { if ($1 == -s) { set %wzip $2- set %wway msg $active %wway opening socket - weather.com: $+ %wzip sockopen weather weather.com 80 } else { set %wzip $1- set %wway echo -ta sockopen weather weather.com 80 } } on *:sockopen:weather:{ sockwrite -nt $sockname GET /weather/local/ $+ %wzip HTTP/1.1 sockwrite -nt $sockname Host: http://weather.com sockwrite -nt $sockname $crlf } on *:sockread:weather:{ if ($sockerr) { echo -ta Error: $sockerr halt } else { var %ee sockread %ee if (*Feels Like
*°F
* iswm %ee) { tokenize 32 %ee %wway $htmlfree($1-) sockclose weather } } } alias htmlfree { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ) return %x }