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
Metadata
Release files for py-hacker-news 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| py_hacker_news-1.0.4.tar.gz | 4.9 kB | Without provenance | Details for py_hacker_news-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| py_hacker_news-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for py_hacker_news-1.0.4-py3-none-any.whl |
Total release size: 12.1 kB
Release files / py_hacker_news-1.0.4.tar.gz
| Download URL | py_hacker_news-1.0.4.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8848420ff1fe39c9c5920c27c00bd4edf0ba3802a77f8b554bd375fb06d453e5
|
|
BLAKE2b-256 checksum How to use checksums |
4559e6485843bb4a3981f4f64f691e01de623331707e152db3f64b7646012380
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / py_hacker_news-1.0.4-py3-none-any.whl
| Download URL | py_hacker_news-1.0.4-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4648abef35377fd0951ce83562a77d7c51dbbdddbb96ae0c29a525c3bc10d58a
|
|
BLAKE2b-256 checksum How to use checksums |
6d93625a3372e75dcf50bbaa96c1fd4dbf53d63c3cc88ddcc85061dae78de8b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for py-hacker-news 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.