Live data from Hacker News

Show HN: Hacker News without leaving your terminal

github.com

21–28 of 28 posts

Re: Show HN: Hacker News without leaving your terminal

#21
post #18

I used pkrumins ncurses hacker-top program, it's nice. https://github.com/pkrumins/hacker-top Sometime it has a bug to retrieve news, and I fixed it. https://github.com/Nic0/hacker-top 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 ;)

Re: Show HN: Hacker News without leaving your terminal

#23
post #8

kind of cool but in the end, you need to open your browser anyway !!

Here is one way to force your browser to open a URL by entering a terminal command: echo 'open location "http://my.domain.com/some/file.html"' | osascript

You can also open an url with:

   open http://my.domain.com/some/file.html

Re: Show HN: Hacker News without leaving your terminal

#25
post #24

Dear Sir, You have committed an egregious atrocity: you parse XML with a regex. Please read this classic post: http://goo.gl/wPtKX Thank you, Internet

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?

Re: Show HN: Hacker News without leaving your terminal

#26

Here's a couple of edits that will pull colors from the 256-color (XTerm) palette and make the titles bold: blue_highlight=`echo "\033[0;38;5;68m"` brown_highlight=`echo "\033[0;1;38;5;202m"` . . . . . . (end of script) echo "\033[0m"

Thanks, fixed in master. Also updated so only uses colors via a -c argument.

Re: Show HN: Hacker News without leaving your terminal

#27
post #12

I tried it on CentOS (RHEL) 5.6 [admin@gold admin]# hackernews sed: invalid option -- E [admin@gold admin]# sed --version GNU sed version 4.1.5

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.

There is a patch in master to support both Debian and Mac OS X. OS X doesn't use GNU sed which was the source of the problem.
Post reply on HN