Hello,
I want to know how to determine a location from IP address in Rails.
For example, 124.108.48.2 is from which country, using which ISP, Time
Zone, lat and lng.
Appreciate if have any ideas?
Thanks
Chamnap
Hello,
I want to know how to determine a location from IP address in Rails.
For example, 124.108.48.2 is from which country, using which ISP, Time
Zone, lat and lng.
Appreciate if have any ideas?
Thanks
Chamnap
steve
Chamnap wrote:
Hello,
I want to know how to determine a location from IP address in Rails.
For example, 124.108.48.2 is from which country, using which ISP, Time
Zone, lat and lng.
Appreciate if have any ideas?Thanks
Chamnap
If you are looking for a free one you can use this:
www . hostip . info
(the spam catchers weren’t letting this through the normal way so I
added the whitespace).
There are better ones out there that are commercial. The data is a
little bit better so with the commercial ones if I remember so, you’ll
have to weigh the difference between cost and accuracy.
To get Ruby on Rails to work with the site I mentioned, you will have to
send your request in this format:
http://api. hostip . info/?ip=12.215.42.19
(remove the whitespace)
and it will return your data in XML:
gml:nameSugar Grove, IL</gml:name>
UNITED STATES
US
so you’ll have to parse the returned XML via Ruby on Rails to get what
you need.
I hope this gets you in the right direction. Unfortunately, in terms of
exactly how to code it in Ruby on Rails, I am not sure.
Thanks steve and mike.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs