7 ms·
Show HN: Real Time Users – Add a real-time user counter to your site
- Olscore 10y agoBringing hit counters back in fashion, eh?
- fredrivett 10y agoWe saw 2 people request some form of site counter in the past few weeks, which was enough for us to spend a weekend hacking on it. Who knows whether anyone will actually use it. There's also a leaderboard, to track who does. https://realtimeusers.bycontrast.co/leaderboard https://realtimeusers.bycontrast.co/leaderboard
- cdubzzz 10y agoRe: https://highscore.money/ https://highscore.money/ Just like the million dollar homepage guy - why didn't I think of that!?
- fredrivett 10y agoHaha yep! Its a cool idea. Marc's got a good network though, which helps when you're starting out with a product like that. Gotta avoid the tumbleweed effect at all costs.
- fredrivett 10y agoHey all. Last week Marc Kohlbrugge launched https://highscore.money/ https://highscore.money/. Following that, he sent out a tweet, asking if anyone knew of a good real time user counter to add to his site. https://twitter.com/marckohlbrugge/status/737388891246891008 https://twitter.com/marckohlbrugge/status/737388891246891008 No-one did, so we made one. Real Time Users is just that. We made it this weekend. I wrote a quick post introducing it, so feel free to look at that for more details. https://blog.wearecontrast.com/make-stuff-ff82f78cf5a9#.s8mggqigh https://blog.wearecontrast.com/make-stuff-ff82f78cf5a9#.s8mg... Feel free to ask any questions, I'll be about all day.
- Gys 10y agoSo actually nobody bothered to Google for that ? https://www.google.com/search?q=user+counter https://www.google.com/search?q=user+counter brings many websites offering this in various fonts, sizes and colors. But then again, 'good' can be very subjective...
- fredrivett 10y agoThere's nearly always existing solutions to problems. From my experience, if they're not well known enough, that's a good enough reason to build something. There's still space in that area. For us, this was just a fun hackathon over the weekend. But who knows where it will go, maybe we'll continue developing it out and it'll become something more. We'll see. You are right though! :)
- jtmarmon 10y agoi find it hard to believe google analytics is "not well known enough"...does this do something different?
- fredrivett 10y agoThis is a simple way to display the counter to your users. GA is for internal use, whereas this shows how popular your site is at any time.
- colinbartlett 10y agoIt's very frustrating to me when people here take the time to build something and then solicit feedback from HN, only to have someone immediately post "That already exists". Sure, it can be nice to solicit explanations of differentiation from the OP to help understand the use cases, but these kind of sweeping comments aren't helpful to anyone.
- fredrivett 10y agoI think there's some value to see other options solving a similar problem, but I agree the "that already exists" mantra is pretty limited. For a long time we never shipped anything due to the need to try and make the next Facebook in one go. It crippled our creativity. These days we've learnt that it's ok to build and launch something that's been done before, the most important thing is learning to launch. For us we launched this to get back into the swing of launching stuff after a few months since our last launch. This is entirely an MVP, built and launched in under 15 hours total design/dev time. Thanks for taking the time to comment Colin.
- codepie 10y agoIs it just me or this website is heavy on CPU? Increased my CPU usage by 50%.
- fredrivett 10y agoHmm, could be. It might be the CSS animations on the numbers on the homepage there. I'll look into it. Thanks for the heads up
- oneloop 10y agoDo one thing right. Get rid of anything that's not essential, like animations.
- fredrivett 10y agoI think there's room for adding style around substance, but not if it causes issues. I wasn't aware of the performance issues, but now I know I'll be sure to look at this when I get home from work.
- mosselman 10y agoYou could look at moving the animations to the GPU. You could read this ( I just duckduckgoed this, but it looked like what I remember it involves to do this). http://blog.teamtreehouse.com/increase-your-sites-performance-with-hardware-accelerated-css http://blog.teamtreehouse.com/increase-your-sites-performanc...
- fredrivett 10y agoPerfect, thanks Mosselman. Will take a look!
- Splendor 10y agoNot just you. This site crashed Firefox for me.
- subie 10y agoIs using ajax calls on a loop the best way to track users on a site? I'm curious because when I look at pages using google analytics I don't see any repeating requests in the network console. Does google mask the requests or use some other protocol?
- mikeaag 10y agoHey subie, I'm one of the creators of Real Time Users. Only 1 AJAX call get sent to 'track' you on the site for each page load. The AJAX calls you're seeing are asking the server for the latest number of users on the site so that we can update the value displayed. This isnt the most efficient way of doing this, as if the site has a low number of users, the count will return the same number most of the time. A better way would be to use websockets, however i only have limited knowledge of using websockets so we decided it was best to just stick to the tech we knew (Especially as we built it in a weekend). If people start using this more, we might update it to use websockets though. Hope that answers your questions. Let me know if theres anything else you'd like to know.
- subie 10y agoOhh I didn't even look in depth at the request. Thanks for the response! I'd say ajax is probably the right way as far as polling for the data goes. Using web sockets for polling incredibly simple data doesn't seem necessary.
- mikeaag 10y agoThe benefit of using websockets is that each user's browser doesnt need to constantly be requesting the number of users from our server. If the number of users on the site hasnt changed, then with AJAX polling, its a wasted request. But with websockets there is no waste, the client gets pushed the updates when they happen from the server. Having said all that, with the number of requests that we're getting at the moment, i dont think it makes much of a difference. Though im guessing if we got a lot more traffic, then websockets would probably reduce our server load.
- 10y ago
- shujito 10y agoWhat's the backend made of?
- nevi-me 10y agoWhy not just use websockets? I use socket.io on my site. I keep track of socket IDs in memory, if a connection is lost, I get a disconnect event, and vice versa. Socket events are sent to users when the number changes. I manage the frequency of socket emits using RxJS, to prevent sending too many changes to users. https://movinggauteng.co.za https://movinggauteng.co.za, there's a counter at the top of the page. EDIT: Only saw a comment about why the OP used Ajax after posting this.
- WWKong 10y agoCan I get your help in deploying socket.io to Google App Engine? Is it possible? It works locally for me but Google app engine seems to close out the websocket. http://stackoverflow.com/questions/37401250/how-do-i-deploy-socket-io-to-google-app-engine http://stackoverflow.com/questions/37401250/how-do-i-deploy-...
- simplify 10y agoWebsockets would overkill for this kind of feature – you don't need realtime two-way communication. Server sent events (SSE) [1] are a much better alternative; it's a simple, long-lived HTTP request where the server can push data to the client. They're built into most browsers [2], and the client-side polyfill [3] is small (2kb gzipped). [1] https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events https://developer.mozilla.org/en-US/docs/Web/API/Server-sent... [2] http://caniuse.com/#search=server-sent%20events http://caniuse.com/#search=server-sent%20events [3] https://github.com/Yaffle/EventSource https://github.com/Yaffle/EventSource
- nevi-me 10y agoFair enough, but what happens if I open a page, send an Ajax call to say "add 1 user", then promptly close that page? I don't know what OP is doing to detect that a user is no longer on the site. The reasons why I used WebSockets are that I get a disconnect event immediately, and I was already using WebSockets for other features on the site
- 10y ago
- pech0rin 10y agohttps://bycontrast.co/ https://bycontrast.co/ is just a "hello world", is there a normal site for that
- dyscrete 10y agohttps://wearecontrast.com/ https://wearecontrast.com/ https://blog.wearecontrast.com/ https://blog.wearecontrast.com/
- fredrivett 10y agoYep, those are the main sites. We only bought bycontrast.co at the weekend, need to setup a redirect there! :)
- llamataboot 10y agoNo link to the code on github? (or gitlab or wherever?)
- fredrivett 10y agoNot currently, but we may do that soon. Having only built this last weekend we haven't stopped to consider the options around open sourcing yet.