https://github.com/amscotti/hacker_news
A command line tool that shows the top stories from Hacker News using the Hacker News API from Firebase
https://github.com/amscotti/hacker_news
command-line hackernews hackernews-api news
Last synced: 3 months ago
JSON representation
A command line tool that shows the top stories from Hacker News using the Hacker News API from Firebase
- Host: GitHub
- URL: https://github.com/amscotti/hacker_news
- Owner: amscotti
- License: mit
- Created: 2021-12-08T03:21:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-10T22:27:42.000Z (over 1 year ago)
- Last Synced: 2025-04-02T13:09:20.102Z (3 months ago)
- Topics: command-line, hackernews, hackernews-api, news
- Language: Go
- Homepage:
- Size: 526 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hacker_news
A command line tool that shows the top stories from [Hacker News](https://news.ycombinator.com/) using the [Hacker News API from Firebase](https://github.com/HackerNews/API).
This is a port of an dotnet version, [hn-top](https://github.com/amscotti/hn-top) which I used to learn about Go and understand how to keep the order of the stories when using Goroutines.

## Building and Running
### With Go
To build and run the application, follow these steps:
1. Clone the repository.
2. Navigate to the root directory of the project.
3. Build the binary with `go build`.
4. Run the binary with `./hacker_news`.### With Docker
To build and run the application with Docker, follow these steps:
1. Clone the repository.
2. Navigate to the root directory of the project.
3. Build the Docker image with `docker build -t hacker_news .`.
4. Run the Docker container with `docker run hacker_news`.### With pre-built Docker image from [ghcr.io](https://github.com/amscotti/hacker_news/pkgs/container/hacker_news)
To download and run the pre-built Docker image, follow these steps:
1. Install Docker.
2. Run the command `docker run ghcr.io/amscotti/hacker_news:main`.### Command Line Arguments
The following command line arguments are available:
```
Usage of ./hacker_news:
-n int
Specify the number of top stories to display. (default: 30)
-u Include the source URLs of the stories in the output.
```