Command line tool to display HN top stories
Project description
hckrnews - Hacker News CLI Viewer
A command line tool to display the top stories from Hacker News using the API provided by hckrnews.com.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Features
- View top stories from Hacker News in your terminal
- Color-coded titles based on story score:
- Green: Top 10 stories
- Yellow: Stories ranked 11-20
- Purple: Stories in the top 50% (excluding top 20)
- Grey: Other stories
- 2-column layout showing titles and points/comments
- Various filtering options:
- Top 10 stories
- Top 20 stories
- Top 50% of stories
- All stories
- Navigation between different days
- Multiple sorting options:
- By points
- By comments
- By submission date
- Keyboard shortcuts for all actions
Installation
From PyPI (Recommended)
Install directly from PyPI:
pip install hckrnews
Or if you're using uv:
uv pip install hckrnews
Development Installation
Clone this repository and install in development mode:
cd hckrnews
pip install -e .
Or if you're using uv:
cd hckrnews
uv pip install -e .
Usage
Simply run the hckrnews command to start the application:
hckrnews
Keyboard Shortcuts
j- Previous day (earlier)k- Next day (later)l- Open comments page in browserspace- Open story URL in browser1- Show top 10 stories2- Show top 20 stories3- Show top 50% stories4- Show all storiesp- Sort by pointsc- Sort by commentsd- Sort by dater- Refresh current viewq- Quit the application- Arrow keys - Navigate between stories
Data Source
Data is fetched from the hckrnews.com API:
https://hckrnews.com/data/YYYYMMDD.js
Development Tools
Version Bumping
The project includes a version bumping script that helps maintain consistent versioning across the codebase. It updates:
- Version in pyproject.toml
- User-Agent version in API requests
- Git commits (optional)
- Git tags (optional)
Usage:
# Increment patch version (0.1.0 -> 0.1.1)
python bump_version.py patch
# Increment minor version (0.1.0 -> 0.2.0)
python bump_version.py minor
# Increment major version (0.1.0 -> 1.0.0)
python bump_version.py major
# Set specific version
python bump_version.py --set 0.2.0
# Increment version and create git commit
python bump_version.py patch --commit
# Increment version, create commit and git tag
python bump_version.py patch --tag
When using the --tag option, the script automatically creates a commit with message "chore: version bump to x.y.z" before tagging.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hckrnews-0.1.1.tar.gz.
File metadata
- Download URL: hckrnews-0.1.1.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14720734319d10e563563e254e55549c941d669ce17c89bf774cf327354de2b7
|
|
| MD5 |
6f594d06f663142ec25eaa586561598d
|
|
| BLAKE2b-256 |
d19d7496d756d599a0fa9e222719f960993570c7443a1ce6990b1c4d69bfa427
|
File details
Details for the file hckrnews-0.1.1-py3-none-any.whl.
File metadata
- Download URL: hckrnews-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef11e721e2f0543fada61664f17b0d4ea82450234493a50ec7525b11d3c0db52
|
|
| MD5 |
1fce82f154da68caeaff80cf5ab2a133
|
|
| BLAKE2b-256 |
21f94392e02d0c153485baf379f2e9cf4d05075e7a1a18ab84424a01a86d061a
|