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
transformerspipeline. - 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_REPOEnsure 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_KEYTWITTER_API_SECRETTWITTER_ACCESS_TOKENTWITTER_ACCESS_SECRET
Go to your repo ➔ Settings ➔ Secrets and variables ➔ Actions ➔ New repository secret. Add:
TWITTER_API_KEYTWITTER_API_SECRETTWITTER_ACCESS_TOKENTWITTER_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.pyOr use the provided script:
bash test_tweet.shCommit your changes and push:
git add .
git commit -m "Initial commit: Daily AI Tweet bot"
git push- Change the RSS feed: Edit
RSS_FEED_URLintweet.pyto another RSS source. - Change posting time: Modify the
cronentry in.github/workflows/daily_tweet.yml. - Model choice: Update the
summarize_textfunction intweet.pyfor 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