i am developing a product where i need to know from wich country the user is logged in .! and display things according to his geolocation . can any one please help me out with this -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2011-Jan-12 06:43 UTC
Re: How to get geo location with the help of IP address
Rajesh B. wrote in post #974156:> i am developing a product where i need to know from wich country the > user is logged in .! and display things according to his geolocation . > can any one please help me out with thisPerhaps you want to use the new HTML 5 geolocation features. If not, Google has a similar API available to the public. This is an HTML/JS issue and has nothing to do with Rails. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org Sent from my iPhone -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks Marnen. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Didde Brockman
2011-Jan-12 15:23 UTC
Re: Re: How to get geo location with the help of IP address
On Jan 12, 2011, at 7:43 AM, Marnen Laibow-Koser wrote:> Rajesh B. wrote in post #974156: >> i am developing a product where i need to know from wich country the >> user is logged in .! and display things according to his geolocation . >> can any one please help me out with thisGreat! Geolocation is always fun.> Perhaps you want to use the new HTML 5 geolocation features. If not, > Google has a similar API available to the public. This is an HTML/JS > issue and has nothing to do with Rails.You may be correct in this statement, but there''s also the option of segmenting the content on the server side. I.e., in Rails. It can arguably also be a nice attribute to have on a user model for future send-outs or similar. Have a look at https://github.com/cjheath/geoip. Then check out http://www.maxmind.com/app/ip-location. Good luck.> Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > Sent from my iPhone > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2011-Jan-12 16:07 UTC
Re: Re: How to get geo location with the help of IP address
Didde Brockman wrote in post #974306:> On Jan 12, 2011, at 7:43 AM, Marnen Laibow-Koser wrote: > >> Rajesh B. wrote in post #974156: >>> i am developing a product where i need to know from wich country the >>> user is logged in .! and display things according to his geolocation . >>> can any one please help me out with this > > Great! Geolocation is always fun. > >> Perhaps you want to use the new HTML 5 geolocation features. If not, >> Google has a similar API available to the public. This is an HTML/JS >> issue and has nothing to do with Rails. > > You may be correct in this statement, but there''s also the option of > segmenting the content on the server side. I.e., in Rails.Well, of course Rails should *deal with* the data once acquired. But acquiring the user''s location is a job for the client side, isn''t it? Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Peter Hickman
2011-Jan-12 16:32 UTC
Re: Re: Re: How to get geo location with the help of IP address
Or you could use the geoip gem :) http://ruby.about.com/od/gems/a/geoip.htm -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Didde Brockman
2011-Jan-12 16:33 UTC
Re: Re: Re: How to get geo location with the help of IP address
On Jan 12, 2011, at 5:07 PM, Marnen Laibow-Koser wrote:> Didde Brockman wrote in post #974306: >> On Jan 12, 2011, at 7:43 AM, Marnen Laibow-Koser wrote: >> >>> Rajesh B. wrote in post #974156: >>>> i am developing a product where i need to know from wich country the >>>> user is logged in .! and display things according to his geolocation . >>>> can any one please help me out with this >> >> Great! Geolocation is always fun. >> >>> Perhaps you want to use the new HTML 5 geolocation features. If not, >>> Google has a similar API available to the public. This is an HTML/JS >>> issue and has nothing to do with Rails. >> >> You may be correct in this statement, but there''s also the option of >> segmenting the content on the server side. I.e., in Rails. > > Well, of course Rails should *deal with* the data once acquired. But > acquiring the user''s location is a job for the client side, isn''t it?I''m not so sure. It depends on the use case, IMHO. For example. Say you have http://www.mysite.com/ which needs to redirect the visitor to http://www.mysite.co.uk/ if the originating IP resolves to the UK. Using your method, a page would need to load, determine the geographical location and then use meta refresh or a Javascript in order to perform the actual redirect. Using GeoIP on the server side, a redirect_to in the controller could take care of it all in one quick action. But again, it all depends on what you need to do. If it''s a matter of simply varying some sort of UI element, the client side way makes sense. Your mileage may vary :)> Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hassan Schroeder
2011-Jan-12 22:38 UTC
Re: Re: Re: How to get geo location with the help of IP address
On Wed, Jan 12, 2011 at 8:33 AM, Didde Brockman <didde-ntJxCBzZx0j2eFz/2MeuCQ@public.gmane.org> wrote:> I''m not so sure. It depends on the use case, IMHO.+1 If the OP only needs the *country* identified, GeoIP on the server is the easiest solution. For any finer granularity, GeoIP (or any IP-based system) is not very reliable. (At the moment I''m in a moving vehicle south of Pismo Beach California, and GeoIP thinks I''m in Manteca -- *way* off.) But the client-side solutions are still a work in progress too, AFAICT :-) FWIW, -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi, if you want to maintain the data yourself then you might want to consider of getting the data from geolocation providers. We use IP2Location and I think there have Ruby solution available too. Try http://www.ip2location.com/ruby.aspx. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks all :-) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.