

Ask HN: How to locate the unread comments on a HN post since I last visited it? - hariis

Is there a way?
======
slindstr
I always just go to google and type

site:news.ycombinator.com "{keywords}"

but I'd love to know if there is a better way too...

------
megamark16
I just coded up a quick javascript solution using PersistJS and jQuery. This
comment is to test it out.

~~~
megamark16
And it works. Sweet. It's pretty straight forward, just paste this code into
your browser window or add it as a favorite:

javascript: var what_changed =
document.createElement('script');what_changed.setAttribute('src',
'<http://ransomsoft.com/whatchanged.js>);document.body.appendChild(what_changed);

When you run this code it creates a persistant client side store using
PersistJS, then it checks each of the comments on the page and if the
comment's id isn't already in the store it bolds the comment and adds the id
to the store. So the next time you revisit/refresh the page and run the script
again it will see which comments you've already read and only bold the new
ones.

Please feel free to peruse the source code, it's pretty short, but you should
never run anything on your computer you don't feel confident you can trust.
Here's a link to the JS I'm loading into your browser when you run this:

<http://ransomsoft.com/whatchanged.js>

I know I'm going to be using this a lot going forward, and hopefully it'll be
helpful for other people too.

