

Realtime Hacker News - michaelhart
http://realtime.michaelhart.me/

======
tptacek
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?

~~~
michaelhart
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.

------
vic_nyc
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.

~~~
lgeek
> 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.

------
daleharvey
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

------
CWIZO
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?

~~~
michaelhart
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!

------
michaelhart
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)).

------
marcamillion
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.

------
erikano
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>

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

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

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

------
wglb
Really, let's not do this.

------
younata
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.

~~~
michaelhart
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.

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

~~~
michaelhart
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.

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

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

~~~
rgrieselhuber
nginx?

~~~
michaelhart
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 :)

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

