Hacker News new | past | comments | ask | show | jobs | submit login
Realtime Hacker News (michaelhart.me)
38 points by michaelhart on Nov 9, 2010 | hide | past | favorite | 24 comments



I don't get it. Exactly why do I want the Hacker News front page to change out from under me while I read it?


Well, it doesn't update THAT often, so it's not like it's constantly moving :) But that's also the reason why I didn't make realtime conversations... It's too hard to make it not annoying.


Would be interesting if you could post the tech details about how you implemented it. I've been experimenting with websockets in Clojure, Ruby and Node and so far I have found that in practice it's harder to do than the simple tutorials would have make it seem. For example, I realized that due to the same origin policy, the client and server involved have to run on the same ports (not just same machine) which makes it seem that the same server has to serve them.


> For example, I realized that due to the same origin policy, the client and server involved have to run on the same ports (not just same machine) which makes it seem that the same server has to serve them.

Mongrel2 (http://mongrel2.org/home) might help with that.


It's all written in php/codeigniter and mysql. It's very fast thanks to codeigniter being very lightweight and due to caching provided by mysql.

I'll try to write a blog post tomorrow... www.michaelhart.me


This is a nice idea

I agree with the added spacing, also it doesnt matter if backgrounds are very opaque they are still distracting while they are visible.

I would prefer to not have both screens viewable, just the same interface by clicking new / home on the top navigation.

Thanks for doing this, looks like a fun experiment


I just significantly improved caching to further reduce the necessity of hitting Hacker News. This should fix a lot of performance issues as well as blank pages.

As for duplicates, I have tried to make that much less likely by putting the status closer to the update query. There are lot of hits per second, which causes that. (Queries take around 0.005s to perform; if 2 hits within that time period, then it could update the cache twice (or more)).


Add some spacing between items please. It's almost unreadable right now. Also the new/home text backgrounds interfere with the content.

It would also be nice if I could login somehow and vote/comment on your page (real time comments maybe?). Great stuff tho!

edit: just noticed that your version of the home page is completely different than the one here. Or am I missing something?

edit2: scratch that, you display items in reverse order. Why is that?


I wasn't aware, I fixed it :)

As for the text, I'll lower the opacity to like 5% and see if that helps. Also adding spacing now.

Thanks :D

edit: spacing added; looks much better :) thanks again!


This is actually pretty neat. It helps me discover new stories better than a static HN front-page.

I really like the layout and everything.


Interesting. However, I get three duplicate entries. I'm using Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.4) Gecko/20100630 Firefox/3.6.4.

[1]: https://st.atic.co/screenshot/realtime_hn_duplicates.png


I just modified the way the queries run; duplicates should be MUCH less common now.


I'm assuming this shows me items that haven't made the front page? I think that's very useful.


The left side is newest, the right side is news (homepage).


Really, let's not do this.


It's neat.

But, for me, I prefer the regular, static, interface. The main page doesn't change enough to warrant using a a realtime interface.


True, but for many people, like me, we're refreshing HN every few minutes anyway. Why not have the 2 most common pages (for me anyway) on 1 screen powered by ajax to load all of the data. I also cache all of the data on my server in a database, so it actually lessens the load on HN's servers. It turns hundreds of requests into a handful. I also have everything tuned for automatic performance scaling, so if HN responds too slowly, I'll request pages less frequently, or if my server starts getting loaded, I'll increase the interval of the ajax requests.


I shudder for the personal productivity of someone who needs a realtime version Hacker News.


It's getting quite a bit of users, and the average session length is 14 minutes. Quite interesting :) I love it. It's sort of like Gmail, minus the notifications through my phone (which is a good thing, because it would be way too spammy). I can rest assured that when I visit that tab, I see the latest stuff. No refreshing or checking both pages. I have them both, always up to date, and at a glance.


It would be real time if it didn't take an eternity to load. Neat concept though.


Despite how efficient I made it, apache seems to have trouble keeping up. I'm tuning it trying to find a good balance.


nginx?


Apache handles dynamic content better than nginx in most cases. Nginx is usually only desirable when memory is a constraint or for serving static content. I've optimized apache, and it's handling the traffic quite well now with average response times of 20-60ms (including generation and network latency), which is quite nice :)


nice! maybe the new things could show up at the top though? so we wouldn't have to keep scrolling




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: