Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Script to fix expired HN link page (well, sort of) (userscripts.org)
5 points by piyush_soni on Sept 26, 2013 | hide | past | favorite | 4 comments


Author of this short script here. I tried to search about this annoying problem in Hacker News - people complain about it all the time but surprisingly there's been no official fix yet. I just wrote this GreaseMonkey script to auto-redirect to the home page when it happens. Not sure if someone's already done that, but I didn't find one on userscripts.org .


The real solution to this problem would be to keep track of the original link and page # you're on, then go all the way back the beginning and click next X number of times if you get an expired error, programmatically of course.


But the 'More' link always generates a unique id, and there is no page number here (or do I not completely understand what you are trying to say?). And even the content on the home page keeps on changing - so you'll miss out on new stuff if I programmatically fetch the homepage and show the user the new 'More' page after that.

Another solution could be to get a new home page and the 'More' page behind the scenes, merge them, and remove the contents that were already on the user's previous screen through javascript. But that'd be a bit complex and still having fidelity issues. So I just kept it simple.

I can just highlight the new links when redirecting though if you think that'll help.


Or track the seen items, then start back at the beginning and fetch pages till about a page worth of unseen items accumulates?




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

Search: