I put this together since I find myself switching away from the terminal to see if anything new popped up in HN. There might be similar ones out there, didn't bother looking. It was a quick experiment, which might end up with a few more features.
Certainly a nice way to follow HN, the only advantage with the website, it to have gray links on already visited links. That's mainly why I don't use it anymore.
A "solution" to this could be a small local cache or sqlite db. Say you use Chrome, then you could have a cronjob which checks your history (given you're not in cognito) sqlite db for links in your last `$ hackernews` run. Not saying it's an adequate way to solve it, but it certainly is a hack ;)
You're altering the terminal colors without resetting them. You should output a reset code after you're done (\033[0m IIRC?) or (drastically) issue `reset`. Although, a blue terminal is kind of a nice change.
Changing "sed -E" to "sed -r" and all instances of "==" to "=" makes this script run on my Debian system. Unfortunately, it leaves the terminal blue when it is done.
If you add a line like the following to the end of the script, any color changes should be undone:
echo "\033[0m"
Also, I believe Debian's /bin/sh is "dash" whereas it is "bash" on most other systems. You could change your copy of the script's header to use "/bin/bash" instead of "sh" (assuming that bash is installed too), which is easier than fixing equal-signs and such.
As far as the original code is concerned, using "perl" may be slightly more portable than "sed -E".
I was counting on someone pointing me to that. Well aware of it and appreciate the reality check. I did this as a quick-and-dirty solution, I haven't tried parsing XML in shell, ever. Do you have suggestions?
Certainly a nice way to follow HN, the only advantage with the website, it to have gray links on already visited links. That's mainly why I don't use it anymore.