X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=data%2Frbot%2Fplugins%2Fgeoip.rb;h=615511728df524469571276977a16965ac1579f7;hb=52c9564c96dbf95e5c883e41940527f2394ba55a;hp=96dcf9d23ce2edca1ef62317ad511a1939686d92;hpb=235634f64decfd4c1c20574474faf0267c8772c5;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/geoip.rb b/data/rbot/plugins/geoip.rb index 96dcf9d2..61551172 100755 --- a/data/rbot/plugins/geoip.rb +++ b/data/rbot/plugins/geoip.rb @@ -9,7 +9,7 @@ # # Resolves the geographic locations of users (network-wide) and IP addresses -module GeoIP +module ::GeoIP class InvalidHostError < RuntimeError; end GEO_IP_PRIMARY = "http://lakka.kapsi.fi:40086/lookup.yaml?host=" @@ -19,7 +19,9 @@ module GeoIP REGEX = { :country => %r{Country:.*? (.*?)}m, :region => %r{Region:.*?(.*?)}m, - :city => %r{City:.*?(.*?)}m + :city => %r{City:.*?(.*?)}m, + :lat => %r{Latitude:.*?(.*?)}m, + :lon => %r{Longitude:.*?(.*?)}m } def self.valid_host?(hostname)