A command line tool that shows the top stories from Hacker News using the Hacker News API from Firebase.
This is a port of an dotnet version, hn-top which I used to learn about Go and understand how to keep the order of the stories when using Goroutines.
To build and run the application, follow these steps:
- Clone the repository.
- Navigate to the root directory of the project.
- Build the binary with
go build
. - Run the binary with
./hacker_news
.
To build and run the application with Docker, follow these steps:
- Clone the repository.
- Navigate to the root directory of the project.
- Build the Docker image with
docker build -t hacker_news .
. - Run the Docker container with
docker run hacker_news
.
With pre-built Docker image from ghcr.io
To download and run the pre-built Docker image, follow these steps:
- Install Docker.
- Run the command
docker run ghcr.io/amscotti/hacker_news:main
.
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.