This GitHub Action posts daily summaries of the latest AI research/news from an RSS feed (default: arXiv cs.AI) as concise tweets. Summaries are generated using open-source HuggingFace models.
- Automated: Runs every day at 10 PM IST (16:30 UTC) via GitHub Actions.
- Summarizes: Uses HuggingFace's free
transformers
pipeline. - Tweets: Posts to Twitter/X using Tweepy.
- Secure: Credentials managed via GitHub Secrets—no paid APIs.
.
├── .github/workflows/daily_tweet.yml # GitHub Actions workflow
├── README.md
├── requirements.txt
├── tweet.py # Main script
├── test_tweet.sh # (Optional) Shell script for local testing
git clone https://github.com/YOUR_USERNAME/YOUR_REPO.git
cd YOUR_REPO
Ensure Python 3.10+ is installed.
python -m pip install --upgrade pip
pip install -r requirements.txt
- Create a Twitter Developer App.
- Generate your keys/tokens:
TWITTER_API_KEY
TWITTER_API_SECRET
TWITTER_ACCESS_TOKEN
TWITTER_ACCESS_SECRET
Go to your repo ➔ Settings ➔ Secrets and variables ➔ Actions ➔ New repository secret. Add:
TWITTER_API_KEY
TWITTER_API_SECRET
TWITTER_ACCESS_TOKEN
TWITTER_ACCESS_SECRET
Create a .env
file or export credentials as environment variables:
export TWITTER_API_KEY=...
export TWITTER_API_SECRET=...
export TWITTER_ACCESS_TOKEN=...
export TWITTER_ACCESS_SECRET=...
python tweet.py
Or use the provided script:
bash test_tweet.sh
Commit your changes and push:
git add .
git commit -m "Initial commit: Daily AI Tweet bot"
git push
- Change the RSS feed: Edit
RSS_FEED_URL
intweet.py
to another RSS source. - Change posting time: Modify the
cron
entry in.github/workflows/daily_tweet.yml
. - Model choice: Update the
summarize_text
function intweet.py
for alternative HuggingFace models.
- Missing dependencies: Run
pip install -r requirements.txt
. - API errors: Confirm all credentials are set and correct.
- Tweet too long?: Script auto-truncates, but review logs for skipped posts.
MIT