Live data from Hacker News

Open Source Visitor.js

github.com

31–40 of 56 posts

Re: Open Source Visitor.js

#32
post #27

The original visitor.js identified my city correctly; this only put me in the USA. Is there a free reliable precise geolocation service that can take as many hits as a script like this could throw at it?

[deleted]

Re: Open Source Visitor.js

#33
post #27

The original visitor.js identified my city correctly; this only put me in the USA. Is there a free reliable precise geolocation service that can take as many hits as a script like this could throw at it?

[deleted]

Re: Open Source Visitor.js

#35
post #27

The original visitor.js identified my city correctly; this only put me in the USA. Is there a free reliable precise geolocation service that can take as many hits as a script like this could throw at it?

Your best bet is html5 geolocation + modernizr.js + a shim. Browsers that support html5 geolocation will return highly accurate results while those that don't support it will fall back to calling the google maps api (ip to geo).

https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Brow...

Re: Open Source Visitor.js

#36

The only thing that would make this better is to have it in coffeescript... :) which I might do for you if you don't.

I thought about doing that. I've used a lot of coffeescript in the past, but I just didn't see it being a big advantage here. The biggest issue with using CoffeeScript here is that I wanted control over the syntax as I wanted to have less code. CoffeeScript (generated) really creates more code than what it's worth.

Re: Open Source Visitor.js

#37
post #27

The original visitor.js identified my city correctly; this only put me in the USA. Is there a free reliable precise geolocation service that can take as many hits as a script like this could throw at it?

I added in support for http://ipinfodb.com/ (see bottom of README) which might be better than Google's api, although you need to register for an API key. You might want to give that a shot.

Re: Open Source Visitor.js

#38
What are the ethical concerns about using this and storing the data? If I wanted to use this on my site, should I let visitors know, or is this data fair game to store? I rather not use the location data (or any of it) if there could be an issue.

Re: Open Source Visitor.js

#39

Localization doesn't seem to work very well. I'm in Waterloo, Canada. This is what the script outputs for me: > session.locale.country "US" > session.locale.location undefined

I'm in Nairobi, Kenya. The output indicates I'm in the US as well.

Re: Open Source Visitor.js

#40

Localization doesn't seem to work very well. I'm in Waterloo, Canada. This is what the script outputs for me: > session.locale.country "US" > session.locale.location undefined

Are you not confusing

1) session.locale, which is the locale (ie. regional settings) configuration of your browser and might very well be US,

and

2) session.location, which gives your geographic location ?

Post reply on HN