This is a simple Python project that scrapes the comments of top hackernews posts and displays summarizes them using GPT-3.5 OpenAI API.
- Fetch a specified number of top posts from Hacker News.
- Parse all the comments and summarize the using GPT-3.5.
- Display the titles and comment summaries in a simple GUI using tkinter.
- Clone the repository:
git clone https://github.com/filipmrc/hn-summaries.git
- Install the required packages:
pip install -r requirements.txt
Note: If you're using a standard Python installation, the tkinter
package should already be included. However, if you're using a Python distribution that doesn't include tkinter
by default (such as some Linux distributions), you might need to install it separately.
- Set the OPENAI_API_KEY env variable to your API key
export OPENAI_API_KEY="<your key here>"
- Run the script:
python main.py
-
Enter the number of posts you want to fetch in the "num posts" entry field.
-
Enter the number of comments you want to use for the summary in the "num comments" field.
-
Click the "Get summaries" button to display the titles in the text area below.
This project is released under the MIT License. See the LICENSE file for details.