Reddit-like Collapsible Threads for Hacker News
Tuesday, February 16th, 2010 at 10:24 +0000 (UTC) by Alexander KirkI enjoy consuming and participating at Hacker News by Y Combinator resp. Paul Graham.
One thing that needs improvement is the reading comments there. At times it happens that the first comment develops into a huge thread, and then the second top-level comment (which might also be well worth reading) disappears somewhere down into the page.
Reddit has combatted this common problem by making threads easily collapsible. I think it is worth having this also on Hacker News, so I implemented it and wrapped it into a bookmarklet so that you can use this functionality on-demand at Hacker News.
Drag this to your bookmarks bar: collapsible threads
As soon as it is available in your bookmarks bar, go to Hacker News and click on it when viewing a comments page. Next to each thread a symbol [+] will appear. Click it to collapse the thread and it will change to a [-]. Click that to expand the thread again.
I have licensed the source code under an MIT License. Click here to view the source code of hackernews-collapsible-threads.js. (Actually for caching reasons the bookmarklet currently loads hackernews-collapsible-threads-v4.js which is actually just the same)
The Hacker News HTML source code seems quite fragile in the sense that the comments section of a page can't be identified in a really unique way (for example it does not have an HTML id attribute), so it might break when the layout of the page changes. This is why the bookmarklet is actually only a loader for the script on my server. I have tuned the HTTP headers in a way that your browser should properly cache the script so that the speed of my server should not affect the loading of the bookmarklet.
Enjoy :)
If you use Hackernews on another URL than news.ycombinator.com or hackerne.ws, use this bookmarklet: collapsible threads (no domain check)
February 16th, 2010 at 11:06 +0000 (UTC)
Social comments and analytics for this post...
This post was mentioned on Twitter by akirk: New blog post: Reddit-like Collapsible Threads for Hacker News http://alexander.kirk.at/2010/02/16/collapsible-threads-for-hacker-news/...
February 16th, 2010 at 16:27 +0000 (UTC)
[...] Read more from the original source: Reddit-like Collapsible Threads for Hacker News » alexander kirk … [...]
February 18th, 2010 at 20:54 +0000 (UTC)
How about making it a Greasemonkey script so one do not have to click on a bookmarklet?
February 21st, 2010 at 08:40 +0000 (UTC)
Is this still working? It's broken for me. (Chrome 4.0.249.89, Win7)
February 21st, 2010 at 10:30 +0000 (UTC)
Yes it's working, just also tried it under Chrome (Mac, but should be the same).
February 23rd, 2010 at 03:32 +0000 (UTC)
Works for me too now. The other day it was failing on this thread:
http://news.ycombinator.com/item?id=1139185