08 September 2009

Hacker News bookmarklet

A bookmarklet for Hacker News.
It helps you read comments. It does 4 things:
  • sort by root comment, newest to oldest (byParent)
  • sort by latest reply in comment thread, newest to oldest (byReply)
  • shows you how many people have replied to your comment (example "4 replies")
  • updates page with new comments and marks them as such (reload)
Here is the bookmarklet: hn.js

Here it is under bitbucket: hnjs

Sorting restructures the DOM. Only the reload function hits the server. Of course any changes to the HTML will break this badly. I've tested this with FF 3.5 & Safari 4 under OS X. And under latest Chrome in WinXP.