I am designing an events site and would like people to see a homepage based upon the events that are in their area.
Could this could also be done with a login, if they register their address?
I am designing an events site and would like people to see a homepage based upon the events that are in their area.
Could this could also be done with a login, if they register their address?
You must be logged in to post a comment.
The latter has a nice explanation how to use modernizer which could then combine html5/geolocation with some webservice or something.
It is possible to get very fuzzy location information for most people, most of the time by using the IP address and a geoIP service. I say “fuzzy” because what you frequently get is the location of the ISP’s servers, not the specific location of the particular IP address. For example, from home my IP comes up listed as being about 30-40 miles away from where I actually am. Also, some people may be visiting through a proxy which could be hundreds or thousands of miles away from their actual location. If those are acceptable parameters, then something like…
freegeoip.net limits requests to a 1000 per hour, so be careful that you run the code only when necessary– set a cookie, something. I’d recommend caching the data to reduce requests count and to reduce the overhead/lag of contacting a third party service.