Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:text:.gas *:#: {
- if ($2 !isnum) { halt }
- if ($sock(gas)) { sockclose gas }
- set %gas.zip $2
- sockopen gas www.motortrend.com 80
- sockmark gas msg $chan
- }
- on *:SOCKOPEN:gas:{
- sockwrite -nt $sockname GET /gas_prices/34/ $+ %gas.zip $+ / HTTP/1.1
- sockwrite -nt $sockname Host: www.motortrend.com
- sockwrite -nt $sockname $crlf
- }
- on *:sockread:gas: {
- var %g
- sockread %g
- if (*we are currently* iswm %g) {
- $sock(gas).mark %g
- sockclose gas
- }
- if (*<td class="pad brdr1_b">* iswm %g) {
- hinc -mu4 gas c 1
- $sock(gas).mark 3 $regsubex(%g,/<[^>]*>|\t/g,$chr(32))
- }
- if ($hget(gas,c) == %gas.zip) { sockclose gas }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement