Code Monkey home page Code Monkey logo

hn-cli's Introduction

hn-cli Build Status

CLI to browse Hacker News

demo

Install

$ npm install -g @rafaelrinaldi/hn-cli

Usage

Usage: hn [OPTIONS]

  CLI to browse Hacker News

Example:
  $ hn --limit 10 --keep-open

Options:
  -v --version              Display current software version
  -h --help                 Display help and usage details
  -l --limit                Limit the number of items to display (defaults to 150)
  -k --keep-open            Wether or not to keep the list open after selecting an item (defaults to false)
     --latest               Sort the list by submission date (defaults to false)

Features

  • By default it will list stories using the same order as seen on HN
  • You can change the list order to display the most recent ones by runnig the program with the --latest flag
  • You can use Vim arrow keys j and k to navigate through the list
  • Use gg to scroll to the first item of the list and G to scroll to the last one
  • Hitting the enter key will open the URL in your default browser
  • Hitting the c key will open the HN comments for that story on your default browser
  • Share an item on Twitter by hitting the t key
  • Hitting the r key will refresh the stories and update the current list
  • A status bar is fixed on the bottom of the screen to provide visual feedback about updates and reading progress
  • Use esc, ⌃C or q to close the program

License

MIT © Rafael Rinaldi


Buy me a ☕

hn-cli's People

Contributors

erickbelfy avatar rafaelrinaldi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hn-cli's Issues

Refresh shortcut

Hi,

Thanks. Really nice program. It would be nice to have a refresh feature, maybe with "r" key.

Error : Use of const in strict mode

After installing the package via npm , I executed hn

It shows up the following error message in terminal

/usr/lib/node_modules/@rafaelrinaldi/hn-cli/bin/hn-cli:6
const cli = require('../cli');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3

I using Ubuntu 14.04 LTS.

Fetch latest

Add a feature to fetch only the latest (as in most recent) stories.

Show and open comments

The real important feature of HN are (IMHO) the comments.
So it would be nice to see how many comments and a shortcut to jump to it.

Tests

Write some unit tests to make sure that at least the core features are reliable.

honor BROWSER environment variable

Hi,

If you could check for BROWSER environment variable and use that as the default for viewing, it would be great. My goal is to have commandline apps stay within an xterm. Personally, I'd suggest using 'links' but to each their own. :) thanks!

Support proxies

When running over SOCKS proxies on my corporate network, I received Request timeout ☹ Might want to try again?.

You should support the standard proxy environmental variables:

http_proxy
https_proxy

I believe using got you can pass tunnel in to go through proxies

const got = require('got');
const tunnel = require('tunnel');

got(url, {
    agent: tunnel.httpOverHttp({
        proxy: {
            host: 'localhost'
        }
    })
});

Jump to line

Implement a "jump to line" feature, similar to :n in Vim.

Mark visited items

Having previously visited stories marked as read would be nice. Maybe a symbol or even through text decoration should do it.

Does `--keep-open` even make sense?

Thinking about it now, does --keep-open even make sense? I mean, you can close the program by hitting the escape key whenever you want anyways.

I'm really close to kill this flag.

Thoughts?

Add order by

I would like to know if it is possible to order the news by time, should it be good to get the news up to date.

Could i create an PR for that issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.