mtharrison / hackernews

A command line tool to print out the latest posts on Hacker News to your terminal.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't open posts :(

playeren opened this issue · comments

I love the idea of browsing HN in the terminal! Let me know if you need any additional info.

Node: v0.10.30
Debian 7.6

Output:

  1. A surge of p-values between 0.040 and 0.049 in recent decades [pdf]

  2. Assange 'to leave' Ecuador embassy

  3. KDE Plasma 5 – For Linux users undecided on the kernel’s future

  4. Lorem Ipsum: Of Good and Evil, Google and China

  5. How to Define New Intrinsics in SBCL

  6. Who Made That Paintball?

  7. Tomahawk – A meta source music player

  8. Mitch Hedberg and GIS

  9. Way.js – Simple two-way databinding

  10. Bone chemistry reveals royal lifestyle of Richard III

  11. Mypy – static type checking for Python 3

  12. When Patients Read What Their Doctors Write

  13. PARC Movies [video]

  14. In Silicon Valley, Mergers Must Meet the Toothbrush Test

  15. Machine that keeps lungs alive outside body tested
    prompt: Type post number to open, or 0 to quit: 1
    prompt: Type post number to open, or 0 to quit:
    /usr/lib/node_modules/hacker-news-cli/index.js:56
    if(error) throw error;
    ^
    Error: Command failed: /bin/sh: 1: xdg-open: not found

    at ChildProcess.exithandler (child_process.js:648:15)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Socket. (child_process.js:969:11)
    at Socket.emit (events.js:95:17)
    at Pipe.close (net.js:465:12)
    root@li714-207:/var/www/nodestuff#

Installed xdg-utils - that helped! :D

Hi @playeren

I was trying to find a shell command for 'open in browser' for each platform. Here's what I'm using:

const shellOpenCommand = {
  'win32': 'start ',
  'linux': 'xdg-open ',
  'darwin': 'open '
}[platform];

I'll look into if there's a better option for Linux, otherwise I'll add a warning and instruction in the README. Thanks!