AspiringGuru
AspiringGuru

Reputation: 137

detecting site visitor's city (for a site like Oodle.com)

I am making a website that would allow users to post classified listings, buy/sell products etc. you can think of it as a limited version of Craigslist or oodle.com or something.

I want to automatically filter listings/results by user's city. How do I detect user's city?

There is MaxMind API that I could use to get city from ip address. Anything else?

Hmm.. what's the best way of implementing this? My site is going to be available in only 4-5 cities. If a user from outside of these 4-5 cities visits my site, I'd like to show "all" listings (that is, listings from all over US). Each of these cities have suburbs so I'd like to consider users from nearby suburb cities as part of my target city. How to code this? Should I look at the map and decide which suburbs to consider as part of target city or is there a way to decide target city + radius in miles/kms to be considered part of my target city?

Upvotes: 0

Views: 1172

Answers (2)

vinayrks
vinayrks

Reputation: 847

In my opinion maxmind is good tool for ip detection and mapping with location, Below you can read documentation and they have uploaded sample code too, so you can get help from that http://dev.maxmind.com/geoip/web-services

Upvotes: 0

cdhowie
cdhowie

Reputation: 169038

Sounds like you want something like the GeoIP City service.

Upvotes: 2

Related Questions