2023-09-11
AI Summary by GPT-4
The RSS-GPT tool uses GitHub Actions to automatically generate summaries for RSS feeds using the OpenAI API, and commits a new XML file to the user's GitHub repo. Users can access this feed through GitHub Pages or the raw XML file URL. The process involves forking the RSS-GPT project, setting repository secrets, and configuring the desired RSS sources and filters in `config.ini`. Users can modify the Python script `main.py` and test the setup via GitHub Actions. The system defaults to using GPT-3.5 Turbo for cost-efficiency but can be adjusted for other models. It's designed for easy updates and customization of summaries without repeated API calls for existing articles.

RSS-GPT Configuration

Introduction

Prerequisites

1. GitHub Actions deployment

The main idea is to use GitHub Actions to run Python scripts periodically, the script calls OpenAI API to generate summaries and append them to original RSS entries, then generate a new xml file, and commit it to the repo.

All contents in the repo folder are deployed on GitHub Pages, so you can access the xml file via your GitHub Pages URL, and subscribe to it like normal RSS feeds in any RSS reader.

If you don't want to deploy on GitHub Pages, you can also subscribe to the raw xml file in the repo (URL starts with https://raw.githubusercontent.com), e.g. the xml file URL of this repo is https://raw.githubusercontent.com/yinan-c/RSS-GPT/main/docs/brett-terpstra.xml.

1.1 Fork the project

Go to the project RSS-GPT and fork it to your own repo. I recommend not to change the repo name, if you do so, you'll have to modify main.py in step 3.

1.2 Three Repo Secrets

U_NAME

The username used for git commit, please set to your GitHub username.

U_EMAIL

The email used for git commit, it's the email you used to register GitHub, can be found in GitHub Settings page.

WORK_TOKEN

Since the project involves using scripts to operate repo contents, permissions are needed for the script to modify files in the repo. Apply for a new personal access token (classic) in GitHub settings page and configure the new token as follows:

Copy the token after clicking, make sure to copy it on this page, you won't be able to see the token after leaving this page. If you miss it, you'll have to generate a new one following the steps above.

1.3 Set Repository Secrets

Go to your forked repo, click "Settings" in top menu bar, then click "Secrets and variables" in left sidebar, choose "Actions", then click "New repository secret" at top right.

1.4 Grant required permissions

Enable GitHub Actions access to Pages:

2. Configure RSS sources to merge, filter and summarize

Go to the project, open the "config.ini" file, click the pencil icon at top right to edit code and configure your desired sources. Don't change the first two lines.

[cfg] 
base = "docs/"

Then modify the target language, number of keywords, and summary length in the next 3 lines. The following code is feed-specific configs, format is:

Next are optional filter configs, note all three configs must be set or not set at the same time, error will occur if only one or two of them are set:

Click "Commit changes" at bottom to submit edits.

3 Modify main.py

(if you used default repo name in 1.1 and you don't want to modify prompt, you can skip this step)

4. Configure and test GitHub Actions

Go to the project, click "Actions" in top menu bar, click "cron_job" and choose "Run workflow".

Green check mark means successful run, red x means failure, usually due to errors in edited ini file or incorrect permissions/tokens. Double check if errors occur.

If there are no errors, you should see your feeds on the project README page.

On the left of -> is original URL, right is converted URL to subscribe like any other RSS feeds.

Some extra notes

About feeds refresh frequency

   - cron: '0 */2 * * *' # run every 2 hours
   - cron: '0 */1 * * *' # run every 1 hours
   - cron: '0 0 * * *' # run every day at 00:00
   - cron: '*/30 * * * *' # run every 30 minutes

For more info on cron syntax, see crontab docs or GitHub docs.

What if I don't want to use summarization feature?

About AI summary content

About the usage of OpenAI API

About repo updates

< Separating tasks and non-actionable items RSS-GPT 使用指南 >
Created: 2023-09-11 Updated: 2023-11-07