TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Open Source Visitor.js

198 pointsby codejoustover 13 years ago

24 comments

memnipsover 13 years ago
It is now apparently Session.js <a href="https://github.com/codejoust/session.js" rel="nofollow">https://github.com/codejoust/session.js</a>
bradlyover 13 years ago
Here is a live demo showing your own information. <a href="http://visitorjs.herokuapp.com/" rel="nofollow">http://visitorjs.herokuapp.com/</a><p>Fyi: I am not storing the information.
评论 #3435839 未加载
dslover 13 years ago
Damn, you beat me to it. After I saw the original visitor.js was a paid service (which blew my mind), I started hacking together the JS implementations of most of the functionality I had laying around already.
gojomoover 13 years ago
The original visitor.js identified my city correctly; this only put me in the USA.<p>Is there a free reliable precise geolocation service that can take as many hits as a script like this could throw at it?
评论 #3436328 未加载
评论 #3436393 未加载
评论 #3436199 未加载
评论 #3436189 未加载
评论 #3435975 未加载
peteretepover 13 years ago
I'm glad you've done this, because I'd have wasted a few hours on it I didn't have otherwise :-)
tonywebsterover 13 years ago
I love when disruption disrupts disruption.
grantjgordonover 13 years ago
I don't think there are any ethical issues here. The paid service is doing something that was mostly, if not completely, available in other open source projects such as piwik and OWA in the first place. It's very educational to look at the differences in the way codejoust implemented his javascript vs. these other projects, and very convenient that you don't have to dig through a gigantor open source code base to do it.
slavinover 13 years ago
I don't understand the pricing model behind visitorjs, and we had to implement a similar solution at my company. But the fact is - they created something and shared it here. If you think you can do a better job at it - fine, but why haven't you done it before, or at the very least named it differently. I don't mean to exaggerate, but it just doesn't feel ethical to me.
DannyPageover 13 years ago
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.
评论 #3437241 未加载
评论 #3437710 未加载
Flimmover 13 years ago
Is this version created or endorsed by the authors of the other Visitor.js implementation?
评论 #3435654 未加载
latchkeyover 13 years ago
The best part about this whole thing is the location lookup. Seriously nice job.
josscrowcroftover 13 years ago
I'm super impressed you turned this out so quickly. I think that really sums up the spirit in the HN community...<p>When you look at something that seems overpriced (or wrongly-priced) and you say "hey, I bet I could do this"<p>I still see value in potentially paying for a service like this when it's a big enough pain-point. But I really think they'd have had more traction with a open-source-to-paid model, where anyone can use the client-side code for free, but the extra stats and support provided are worth paying for.
miseover 13 years ago
Having a "first session" and "current session" exposes very interesting functionality. It suddenly provides a quick way to keep track of what search keywords they used to get to the site, and could be later linked to an account if later created.
sbarreover 13 years ago
location is either "null" or "err/google" for me all the time.<p>Although I am probably an edge-case, I'm tethering from an iPhone on Rogers in Canada.<p>Visitor.js (the paid service) correctly positions me in Toronto, Canada though.
评论 #3437177 未加载
wehriamover 13 years ago
Outstanding! I also was going to have to re-implement this.
dchukover 13 years ago
well...that didn't take long
jpulgarinover 13 years ago
Localization doesn't seem to work very well. I'm in Waterloo, Canada. This is what the script outputs for me:<p>&#62; session.locale.country<p>"US"<p>&#62; session.locale.location<p>undefined
评论 #3436624 未加载
评论 #3436497 未加载
kmax12over 13 years ago
where's the server stuff? is google providing everything that the pay service did, but for free?
评论 #3435627 未加载
tomhallettover 13 years ago
i'm curious about the timing here.<p>did you see vistor.js hit HN and rewrite it in a few hours? or were you working on this in isolation and when you saw it on HN decided it was the perfect time to ship?
评论 #3435765 未加载
评论 #3435693 未加载
dlitzover 13 years ago
Visitor.js should be the new FizzBuzz
desireco42over 13 years ago
The only thing that would make this better is to have it in coffeescript... :) which I might do for you if you don't.
评论 #3436359 未加载
alpbover 13 years ago
Gives 404?
评论 #3435772 未加载
burembaover 13 years ago
404?
评论 #3435767 未加载
necenzuratover 13 years ago
after reading visitorjs.com thread i asked myself WHY<p>Question: who would pay 10 bucks a month for using a js file for 30K requests?
评论 #3436995 未加载