Gas Price finder
Platform: mIRC
Published Oct 27, 2008
Updated Sep 18, 2011
!!Fixed!!
copy/paste into a new remote of ur bot
for use within the US
trigger is @gas <number of results 1-10> <zip code>
ex:
Quote
<~napa182> @gas 5 90210
<&Masonic> 76 427 N Crescent Dr Beverly Hills, CA, 90210 $4.499 N/A N/A $5.099
<&Masonic> 76 9988 Wilshire Blvd Beverly Hills, CA, 90210 $3.999 N/A $4.379 N/A
<&Masonic> 76 9460 W Olympic Blvd Beverly Hills, CA, 90212 $4.299 N/A N/A $4.999
<&Masonic> Chevron 1107 N La Cienega Blvd West Hollywood, CA, 90069 $4.159 $4.259 $4.459 $4.399 Lowest Price
<&Masonic> Shell 391 S Robertson Beverly Hills, CA, 90211 $3.959 Lowest Price $4.059 Lowest Price N/A N/A
on $*:text:/^@gas\s(\d+)\s(\d{5})$/iS:#:{
if (!$hget(gas,c) && $regml(1) isnum 1-10) {
if ($sock(gas)) sockclose gas
sockopen gas www.motortrend.com 80
sockmark gas $regml(1) $+(/gas_prices/34/,$regml(2),/) msg #
}
}
on *:load: {
echo 04 -a You Have Just Loaded Napa182's Gas Price Finder
echo 07 -a An irc.EzzyChat.com Production
}
on *:sockopen:gas: {
sockwrite -nt $sockname GET $gettok($sock(gas).mark,2,32) HTTP/1.1
sockwrite -nt $sockname Host: $+($sock(gas).addr,$str($crlf,2))
}
on *:sockread:gas: {
var %g | sockread %g
if (*We are currently* iswm %g) {
$gettok($sock(gas).mark,3-,32) %g
sockclose gas
}
if (*<td class="pad brdr1_b">* iswm %g) {
hinc -mu4 gas c 1
$gettok($sock(gas).mark,3-,32) $regsubex(%g,/<[^>]*>|\t/g,$chr(32))
}
if ($hget(gas,c) = $gettok($sock(gas).mark,1,32)) { sockclose gas }
}