]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
geoip: also read lat/lon coordinates
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 10 Feb 2009 00:08:00 +0000 (01:08 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 10 Feb 2009 00:17:00 +0000 (01:17 +0100)
GeoIP tool also offer latitude and longitude, so read them as well.

data/rbot/plugins/geoip.rb

index 96dcf9d23ce2edca1ef62317ad511a1939686d92..6cf0d993238e02d83c8eb5568ba1366ea411b717 100755 (executable)
@@ -19,7 +19,9 @@ module GeoIP
   REGEX  = {
     :country => %r{Country:.*?<a href=".*?" target="_blank"> (.*?)</a>}m,
     :region  => %r{Region:.*?<a href=".*?" target="_blank">(.*?)</a>}m,
-    :city    => %r{City:.*?<td align="left" class="arial_bold">(.*?)</td>}m
+    :city    => %r{City:.*?<td align="left" class="arial_bold">(.*?)</td>}m,
+    :lat     => %r{Latitude:.*?<td align="left" class="arial_bold">(.*?)</td>}m,
+    :lon     => %r{Longitude:.*?<td align="left" class="arial_bold">(.*?)</td>}m
   }
 
   def self.valid_host?(hostname)