

Save Time On Hacker News: Mark All Read - danmaz74
http://blog.hashtagify.me/2012/05/27/save-time-on-hacker-neww-mark-all-read/

======
alain94040
I wish that when I read a large discussion (100+ comments) there would be a
way to distinguish comments I have already seen. Because for a large
discussion I care about, I'll revisit it several times to see what was added.
Except right now, I have to rescan everythng.

When I was using micromobs.com for discussion groups, they had a very simple
and elegant system: keep all comments in place to preserve context, but grey
out the ones I have already seen. The problem on HN is that it would conflict
with bad comments. Maybe use a different color?

~~~
kens
Yes, please, a way to see new comments in a discussion. One of the unfortunate
side-effects of the current system is that interesting conversations get
killed off too soon because nobody can follow what's being said any more.
(Falling off the front page is also a killer for discussions. It would be nice
if active discussion threads remained visible somewhere.)

I'm not the first person to bring up Usenet here, but it pains me that Usenet
had way more functionality in the 1980s. (Which I don't mean as a criticism of
HN, but a wish for more learning from the past.)

~~~
danmaz74
But how many users were there on usenet? The special thing about HN is that it
keeps a quality of comments way above average without needing to be too
elitist; I think that limiting the conversations (and thus the flame wars
etc.) is a choice.

But to highlight new comments there are many different solutions already, take
a look at the other comments :)

~~~
moe
_The special thing about HN is that it keeps a quality of comments way above
average_

That was in fact also a quality of Usenet, before it went out of fashion for
unclear reasons.

It would be an interesting exercise to mirror (or even _move_ ) HN to a nntp-
server. Personally I believe the signal/noise ratio would improve drastically.

------
jwr
Cool. I expect kill-files will come afterwards. Several more extensions and
hacks like that and we will have built a poor-man's USENET in the browser.

~~~
blahedo
...just like we've built a poor-man's everything else in the browser. I cringe
every time I visit a website with YA (broken) reinvention of YA GUI widget
that has been polished and clean on desktop GUIs for two decades. (I cringe a
lot.)

------
angry-hacker
Great addition, but why not write it as a userscript instead of Chrome plugin?
Chrome, Opera support them natively. You can install it just like an
extension. Firefox needs Greasemonkey to be installed but most power users
have it anyway. Not sure about IE and Safari but problably they can support
userscripts in some way also.

~~~
danmaz74
This was just an experiment, and the extension looked like the easiest way to
do it (I use chrome 90% of the time).

But I was thinking about publishing the source to github; the js is very
simple, if anybody wants to fork it for other browsers is welcome :)

By the way, can you use css files with userscripts?

~~~
angry-hacker
You can but they need to be hosted somewhere or you need to create a link tag
with javascript and add it dynamically...

Something like that:

var css = document.createElement('link'); css.textContent = 'css here';
document.head.appendChild(css);

~~~
danmaz74
This is what I was afraid of. By the way, without the css the functionality
works anywya, it just looks worse.

~~~
notJim
If the project is on github, you can just link to the repo for hosting.

------
readme
Definitely a cool idea but it needs some work.

* Upon installing the plugin, I tried to "hide read" thinking it would hide the posts that I had already viewed, but they were not hidden. It should be possible to hide these with a css selector.

* After installing and clicking a post to read it, then clicking hide read, this post was not hidden (must not be considered read, again, css selector)

Finally I have a feature request: I would like a "mark read" link to appear
next to each link, so that I can mark an individual link read without reading
it.

Great idea and I hope that my feedback can help you to improve the app.

Thanks.

~~~
danmaz74
Thanks for the feedback.

It could be possible to mark individual items read, but hiding the ones you
actually clicked on (without marking them read) is unfortunately impossible:
As pointed out somewhere else in the comments, with javascript you can't read
the "visited" selector, and with only css I could perhaps hide just the
visited link, but not the encasing and trailing TR.

~~~
readme
I figured out another way you can hide links as they are clicked.

With jQuery override the .click() event of every link on the page. Then, when
the link is clicked get the URL of the link from the event parameter that is
passed to .click(). From that information, you can construct a CSS selector
like this one (with jQuery)

$("a[href=\"[http://stackoverflow.com/questions/10668292/is-there-a-
setti...](http://stackoverflow.com/questions/10668292/is-there-a-setting-on-
google-analytics-to-suppress-use-of-cookies-for-users-who\\\]))

Which can then be used to hide the clicked link. The problem now is one of
persisting the data between sessions. Your options are localStorage, remote
storage, and my suggestion: sqlite in webkit a'la:
<http://stackoverflow.com/questions/6200976/sqlite-in-chrome>

After you have saved the "read" urls in SQLite, you should be able to hide the
surrounding data as well in the other <tr> tag by traversing the DOM with
jquery.

I really would love if you did this. Please consider giving it a try.

~~~
readme
It looks like I should have done better markdown formatting on my selector
example. For clarity:

    
    
        $("a[href=\"http://stackoverflow.com/questions/10668292/is-there-a-setting-on-google-analytics-to-suppress-use-of-cookies-for-users-who\"]")

------
dewiz
this is extremely useful and it is one more reason why I really miss Chrome
(and Firefox) on both tablets and smartphone. I read HN mostly on these
devices where HN UX is really poor, this is one of those features I would
love.

Another one is having bigger upvotes buttons and easier clickable links. Too
often I have a hard time to click on the microscopic comments link, other
times I open the wrong news or upvote the wrong one.

~~~
renata
I find <http://ihackernews.com/> to be pretty useful for small-screen devices.

------
jawns
I made a similar Greasemonkey user script a while back, and it's been great:

[http://coding.pressbin.com/74/Update-on-Greasemonkey-
script-...](http://coding.pressbin.com/74/Update-on-Greasemonkey-script-for-
Hacker-News-homepage)

~~~
danmaz74
Cool - so for FF there is already a solution :)

------
jwallaceparker
Looks cool. It would be great if you could differentiate between the items
you've actually visited and those you've "marked as read."

~~~
danmaz74
I tried to do that with CSS :visited selector, but without success at first -
I'll try again as soon as I'll have time!

~~~
angry-hacker
Modern browser won't let you change :visited selector except color... because
of security. A random webpage would have the knowledge of pages you have
visited then :) I think IE7 and below have that bug. And you can't check the
color of a visited link with javascript.

You were able to build a list of controversial webpages (to compare them with
my browser history), put to your css file that a:visited color: red; (just an
example) and check with javascript which links have foreground color red - and
voilaa. You know what pages I have in my history.

You need to save data to localstorage or something like that instead. And you
can only save those clicks which are made from hackernews site... not populate
it from browser history.

~~~
danmaz74
I'll have to try with just css then. I can't keep track of all clicks :)

~~~
angry-hacker
But you can't identify which links are visited... because of security issues I
described. Sorry my english is horrible maybe I described it very in a very
bad way.

<https://bugzilla.mozilla.org/show_bug.cgi?id=147777>

It is fixed in modern browsers now...

~~~
danmaz74
You can't with javascript, but the a:visited selector works in pure CSS,
doesn't it? I'd like to do it so that I don't know which links you actually
visited, but you would see them in a different color anyway. I think this
should work somehow, I'll have to make some more tests.

~~~
angry-hacker
You can only change the color, nothing else... :)

~~~
danmaz74
And that's all I need ;)

------
turshija
Great addition, but not compatible with this:
[https://chrome.google.com/webstore/detail/lgoghlndihpmbbgmbp...](https://chrome.google.com/webstore/detail/lgoghlndihpmbbgmbpjohilcphbfhddd)
Probably because of infinite scroll, I have to scroll down a little bit to
load few pages, then select hide read ...

~~~
danmaz74
I just tried and it works (even if not perfectly, as the colors aren't the
same). What is your problem exactly? Did you try the button at the top of the
page instead of the one at the bottom?

------
branola
Love it! . . . But . . . I have Chrome set to delete all cookies whenever I
close my browser and to save session cookies otherwise. So this extension
works as long as the browser hasn't been closed once. But after the browser is
closed and cookies deleted, the extension forgets what has been read when HN
is reopened.

~~~
danmaz74
Actually it uses html5 localstorage, but if you delete that too, the list gets
reset...

------
sentenza
I wish there was more than one rss feed. What I really want to appear in my
rss reader are the highest rated stories, not all of them.

As it is, using the rss feed is actually more inefficient than visiting the
page every now and then.

~~~
bazzargh
There's an account on twitter called @hackernewsbot that tweets the highest
rated stories. Twitter accounts have RSS feeds, which are a bit awkward to
find, but it's been automated, just type the username in here:
<http://charlieharvey.org.uk/page/twitter_rss>

Which gives:
[https://api.twitter.com/1/statuses/user_timeline.rss?screen_...](https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=hackernewsbot&fetch=+Fetch+RSS+)

Hopefully this gives what you were after?

~~~
bazzargh
Hmm, I did that without looking and it seems the RSS urls aren't complicated
any more. They used to need your uid not your screen name, which is why that
tool exists.

------
Brajeshwar
Cool. Something I asked long time back. Thanks.

------
lini
Cool, but not really compatible with HTTPS Everywhere :( Have to browse HN on
HTTP to see the extension in action.

~~~
danmaz74
Now it works with https. Just update the extension.

------
pm90
I read hacker news from thunderbird via RSS. This problem doesn't exist for me
:)

------
smectos
Someone should consider implementing this functionality into the site.

------
xbryanx
Tried to install. Got an error. "Manifest file is invalid."

~~~
danmaz74
Sorry, it was probably while I was uploading a fixed version for https. Try
again and let me know.

PS: it's really odd though, when I uploaded the new version it gave me an
error and I didn't get to save the changes. I didn't expect the broken
manifest to be live!

~~~
xbryanx
Worked now. Thanks!

------
realrocker
shouldn't it toggle read/unread?

~~~
maybird
This Firefox extension does it:

[https://addons.mozilla.org/en-US/firefox/addon/link-
visitor-...](https://addons.mozilla.org/en-US/firefox/addon/link-visitor-3/)

~~~
realrocker
thanks. i haven't used firefox for 3 years though.

------
sidwyn
Works great, but how do I undo?

~~~
danmaz74
Right now you can't... what is your use case? Was it just because you were
testing, or you would really need an undo?

