Skip to main content

Command Line tool for browsing HackerNews articles

Project description

Py Hacker News

A Simple command line tool written in python to browse Hacker news.

Introduction

Hacker News is a social news website focusing on computer science and entrepreneurship.

py_hacker_news is a command line tool which fetches and displays results from Hackernews website. You can browse latest, top and past articles from the command line itself.

Installation

py_hacker_news is written in python and can be installed with pip.
This program only supports python3
pip3 install py_hacker_news --user
You need to make sure that ~/.local/bin is in your PATH variable.
To add this to the PATH try export PATH=$PATH:~/.local/bin

You can also download source and try
pip install -r requirements.txt
python3 -m hnews

Usage

The tool can be run from the terminal using the hnews command.
You can pass in various arguments to browse different parts of the Hackernews website.
The tool supports the following arguments:

  • type - Type of news to fetch. Options are news, latest, past. Default is news
  • number - number of pages to fetch. Each pages contains 30 articles. Default is 1
  • age - age of the pages to fetch. It only works is 'past' flat is passed.
  • proxy - network proxy if you are using a proxy server.

Example

hnews - displays 30 popular articles from hackernews
hnews -n 5 - displays 150 (30 * 5) popular articles from hackernews
hnews -t latest - displays 30 newest articles from hackernews
hnews -t past -a 20 -n 2 - displays 60 (30 * 2) articles that were on front page 20 days ago from hackernews hnews -p https://proxy_address:port - uses this proxy to connect to fetch articles

Proxy

The tool automatically used proxy from environment variables if no proxy is provided in args. If
a proxy flag is passed, that value is used instead. To set proxy environment variable:
On Linux
export http_proxy=http://user:password@proxy.domain.com:port
export https_proxy=http://user:password@proxy.domain.com:port
export ftp_proxy=http://user:password@proxy.domain.com:port
On Windows
set http_proxy=http://user:password@proxy.domain.com:port
set https_proxy=http://user:password@proxy.domain.com:port

Help

In case of any trouble or if you think that the code could be improved, please open an issue of github.
You can also contact me at hosvarshith@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_hacker_news-1.0.3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

py_hacker_news-1.0.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file py_hacker_news-1.0.3.tar.gz.

File metadata

  • Download URL: py_hacker_news-1.0.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for py_hacker_news-1.0.3.tar.gz
Algorithm Hash digest
SHA256 c59a55d1d46a11127983ad9165359a7db81ff37714ac2143f158c9fc09f91396
MD5 8c6c621e5f52c4adf48c22e6954c33b0
BLAKE2b-256 bc5ef97cbe7c1e5b0d771743754132cabbd70d851eb4efcb0af19f199b922544

See more details on using hashes here.

File details

Details for the file py_hacker_news-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: py_hacker_news-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for py_hacker_news-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 af28565483d8ada61eb50d66e89ca57d98edb3e7b632bc9bc4cb9a524bdc8316
MD5 8cbb071e52084966d1d77642bc281530
BLAKE2b-256 e1c07016b61bffe9bcfddc4da835122801664befb190d07c8ee4e67f09b131ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page