This project automatically fetches news from multiple RSS feeds and posts them to a Discord channel using a webhook. It features intelligent scheduling with random posting patterns via GitHub Actions.
- Smart Random Posting: Different posting patterns for weekdays vs weekends
- Friday Special Bot: Dedicated Friday afternoon posting (4-6 PM)
- Daily Limits: Maximum 10 articles per day with automatic reset
- Log Management: Automatic log rotation and numbering system
- Git Integration: Automatic commits and pushes after each run
-
Environment Variables
- Create a
.envfile with your Discord webhook:DISCORD_WEBHOOK_URL=your_discord_webhook_url
- Create a
-
RSS Feeds
- Add your RSS feed URLs to
rss-feeds.txt, one per line.
- Add your RSS feed URLs to
-
Install Dependencies
npm install -
Manual Run
node rss-to-discord.js
- Schedule: Daily at 8:00 UTC
- Weekdays (Mon-Fri): Random 1-4 posts per day
- Weekends (Sat-Sun): Random 5-8 posts per day
- Daily Limit: Maximum 10 articles per day (resets daily)
- Schedule: Fridays at 4, 5, and 6 PM UTC
- Posts: Random 1-10 posts per hour during the time window
- Total Friday Posts: Up to 30 posts maximum (3 hours × 10 posts)
- Log Rotation: When
log.txtreaches 50 lines, it's cleared and numbering restarts from 1 - Commit Author: Commits are made using your GitHub username and email (requires a Personal Access Token)
- Create a PAT with
reposcope at GitHub Settings > Developer settings > Personal access tokens. - Add the token to your repository secrets as
GH_PAT.
DISCORD_WEBHOOK_URL— Your Discord webhook URLGH_PAT— GitHub Personal Access Token with repo permissionsRSS_URL— (Optional) RSS URL if your script uses this secret
rss-to-discord.js— Main RSS fetching and Discord posting scriptrss-feeds.txt— List of RSS feed URLs (one per line)package.json— Node.js dependencies
log.txt— Log of sent articles with timestampslog_number.txt— Last article number for continuous numberingdaily_count.txt— Daily sent counter (resets at midnight)
.github/workflows/rss-to-discord.yml— Main daily bot workflow.github/workflows/friday-rss-bot.yml— Friday special bot workflow
- Daily Bot: Runs every day at 8:00 UTC, determines the day of week, and posts randomly based on the schedule
- Friday Bot: Runs every Friday at 4, 5, and 6 PM UTC, posting up to 10 times per hour
- Article Selection: Fetches from multiple RSS feeds and posts the latest articles
- Rate Limiting: Includes delays between posts to avoid Discord rate limits
- Git Integration: Automatically commits and pushes log updates after each run
Posting 3 times today
Run #1
[001] OK
Run #2
[002] OK
Run #3
[003] OK
Inspired by @hacktivity-bot