Zip code look up

By napa182 on Oct 27, 2008

!!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
  }
}

Comments

Sign in to comment.
Jace   -  Oct 29, 2008

Rated.`-.-´

 Respond  
SuPeRFlY   -  Oct 27, 2008

Works great.

 Respond  
Jace   -  Oct 27, 2008

Lol works good though.

 Respond  
napa182   -  Oct 27, 2008

Thanks Dan..
yeah that other site had a lame limit...

 Respond  
Jace   -  Oct 27, 2008

Nice Steve and glad you changed web sites;p.I STILL cant rate with this account but."Rate it?...Or Hate it?"...7/10.`-.-´

 Respond  
Jace   -  Oct 27, 2008

hmm didnt see this one yet ima test.`-.-´

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.