yotpoltd / geoip2 Goto Github PK
View Code? Open in Web Editor NEWIntegration with Maxmind GeoIP2 API
License: GNU General Public License v2.0
Integration with Maxmind GeoIP2 API
License: GNU General Public License v2.0
I want to get result based by passing Latitude and Longitude as parameters
Geoip2.city(["19.0901765","72.86873909999997"]) to get result.
Is there anyway ?
I'd like to get lat/lon, or even just the full json array from MaxMind.. is this possible?
Geoip2.location('70.112.225.219')
NoMethodError: undefined method `location' for Geoip2:Module
How do you configure the gem for a rails 4 app?
Not sure where to put the config settings:
Geoip2.configure do |conf|
# Mandatory
conf.license_key = 'Your MaxMind License Key'
conf.user_id = 'Your MaxMind User Id'
# Optional
conf.host = 'geoip.maxmind.com' # Or any host that you would like to work with
conf.base_path = '/geoip/v2.0' # Or any other version of this API
conf.parallel_requests = 5 # Or any other amount of parallel requests that you would like to use
end
Running rake when hashie 2.1.1 is installed there are many failures which all look like this:
Failure/Error: @response = Geoip2.country('62.219.147.28') TypeError: superclass mismatch for class Rash # ./lib/geoip2/client.rb:79:in `block in connection' # ./lib/geoip2/client.rb:74:in `connection' # ./lib/geoip2/client.rb:39:in `block in get' # ./lib/geoip2/client.rb:67:in `call' # ./lib/geoip2/client.rb:67:in `block in preform' # ./lib/geoip2/client.rb:66:in `preform' # ./lib/geoip2/client.rb:38:in `get' # ./lib/geoip2/api/country.rb:5:in `country' # ./lib/geoip2.rb:65:in `method_missing' # ./spec/api/country_spec.rb:7:in `block (4 levels) in ' # ./spec/api/country_spec.rb:6:in `block (3 levels) in '
Hashie 2.1.1 defines Rash which is different from rash's Rash.
I notice that master uses v2.1 of the API but the latest gem appears to use v2.0. Is there any plan on doing a release soon with v2.1 support?
I get nil when request are made in #parallel_requests block. Irb session:
[43] pry(#)> Geoip2.parallel_requests
=> 5
[44] pry(#)> Geoip2.in_parallel do
[44] pry(#)* r1 = Geoip2.city( "186.56.20.108" )
[44] pry(#)* r2 = Geoip2.city( "190.185.255.244" )
[44] pry(#)* end
=> {}
[45] pry(#)> r1
=> nil
[46] pry(#)> r2
=> nil
[47] pry(#)> r1 = Geoip2.city( "186.56.20.108" ) # standalone call works
=> {"continent"=>
{"geoname_id"=>6255150,
"names"=>
{"de"=>"Südamerika",
...etc
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.