HackRecap is a Python project that fetches the top stories from Hacker News, fetches their text content from the original webpage, and summarizes them using OpenAI's text-davinci-03 model. The summarized stories are then displayed in a paginated list on a Flask web app.
Docker, or Python 3.11 and Redis if running without Docker
To get started, follow these steps:
-
Clone this repository:
-
Navigate to the project directory:
cd hackrecap
-
Build the Docker images:
docker compose build
-
Start the Docker containers:
docker compose up
-
Run the summarizer:
OPENAI_KEY=xxx docker compose exec web python summarizer.py
-
Open your web browser and go to http://localhost:8888.
/
index page which returns the HTML version of the summarized stories/api/stories
a JSON endpoint that acceptslimit
andoffset
, returning the summarized stories and their metadata
The following environment variables need to be set to configure the app:
OPENAI_KEY
: Your OpenAI API key (required to use the app).
This project is licensed under the MIT License - see the LICENSE file for details.
- The Hacker News API: https://github.com/HackerNews/API
- Flask: https://flask.palletsprojects.com/en/2.1.x/
- Docker: https://www.docker.com/
- Docker Compose: https://docs.docker.com/compose/
- OpenAI API: https://beta.openai.com/docs/api/
- Redis: https://redis.io/
- SQLite: https://www.sqlite.org/index.html
- Goose: https://github.com/grangier/python-goose