Skip to content

kossov-it/rss-telegram-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

111 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSS News Digest -> Telegram

Automated multilingual news digest delivered to Telegram every 6 hours via GitHub Actions. Fetches from 6 RSS feeds, filters ads, deduplicates, categorizes into News/Tech, and writes one-line summaries in each article's native language using AI.

Total cost: $0/month

How It Works

┌──────────┐    ┌──────────────┐    ┌───────────────┐    ┌──────────┐
│ 6 RSS    │───>│ rss_digest.py│───>│ GitHub Models │───>│ Telegram │
│ Feeds    │    │ (feedparser) │    │ gpt-4o / mini │    │ Bot API  │
└──────────┘    └──────────────┘    │ / nano        │    └──────────┘
                       │            └───────────────┘
                  sent.json (dedup, committed to repo)
  1. Cron every 6h -> fetch up to 10 newest articles per feed
  2. Filter ads by title prefixes, keywords, and link patterns
  3. Deduplicate across feeds using word-overlap similarity
  4. Deduplicate against sent.json history (committed to repo)
  5. One AI call categorizes (News/Tech), writes a one-line summary per article in its native language, and filters any remaining ads
  6. Send compact digest to Telegram (typically 1-2 messages)

Feeds

Feed Language Type
Google News DE German General news
News Mail.ru Russian General news
Golem German Tech
Heise German Tech
MacTechNews German Tech (Apple)
WinFuture German Tech (Windows)

Telegram Output

NEWS
• Bundestag beschließt verschärfte CO2-Ziele ab 2027
• Россия и Китай подписали торговое соглашение на 15%
• EU einigt sich auf strengere KI-Regulierung

TECH
• Apple stellt M5-Chip mit 40% mehr Leistung vor
• Linux 7.0 bringt bessere Energieeffizienz auf Laptops
• Microsoft streicht Windows-Funktion für Millionen Nutzer
• ChatGPT bekommt Langzeitgedächtnis über Sitzungen hinweg

Repo Structure

.github/workflows/rss-digest.yml   <- GitHub Actions cron job
config.py                           <- Feeds, models, ad filters, limits
rss_digest.py                       <- Main script
requirements.txt                    <- Python dependencies
sent.json                           <- Dedup state (auto-managed)

Setup

1. Create Telegram Bot

  1. Message @BotFather on Telegram -> /newbot
  2. Copy the bot token
  3. Add the bot to your group/channel, send any message
  4. Visit https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates
  5. Find the "chat": {"id": ...} value -- that's your chat ID

2. Add Repository Secrets

Go to Settings -> Secrets and variables -> Actions -> New repository secret:

Secret Value
TELEGRAM_BOT_TOKEN Token from BotFather
TELEGRAM_CHAT_ID Chat/channel ID (can be negative for groups)

GITHUB_TOKEN is automatically provided by GitHub Actions -- nothing to configure.

3. Enable GitHub Models

Go to your repo -> Settings -> Copilot -> GitHub Models and enable access. Alternatively, verify at github.com/marketplace/models.

4. Push & Run

git push

Then: Actions tab -> RSS News Digest -> Run workflow (manual trigger to test).

AI Model Fallback

The bot tries models in order until one succeeds (configured in config.py):

Priority Model Role
1 openai/gpt-4o Most capable
2 openai/gpt-4o-mini Good balance
3 openai/gpt-4.1-nano Smallest, fastest

If all models fail, the bot falls back to sending raw headlines without AI processing.

Rate Limits & Quota

GitHub Models (gpt-4o, Low tier, Copilot Free)

Limit Value Our Usage
Requests/day 150 4 (one per 6h run)
Requests/min 15 1
Input tokens/req 8,000 ~3,000
Output tokens/req 4,000 ~2,000
Quota used ~3%/day

GitHub Actions (Free tier)

Limit Value Our Usage
Minutes/month 2,000 ~120 (~1 min x 4 runs/day x 30 days)
Quota used ~6%/month

Ad Filtering

Three layers of ad removal:

  1. Title prefixes -- Anzeige:, Sponsored:, Heise-Angebot:, Реклама:, etc.
  2. Title keywords -- Schnäppchen, Deal des Tages, Rabattaktion, промокод, etc.
  3. Link patterns -- /deal/, /affiliate/, track.adform, etc.
  4. AI filtering -- the AI prompt instructs the model to skip any remaining promotional content

Customization

Edit config.py to:

  • Add/remove RSS feeds (FEEDS)
  • Change articles per feed (ITEMS_PER_FEED, default: 10)
  • Reorder or swap AI models (AI_MODELS)
  • Adjust temperature or token budget (AI_TEMPERATURE, AI_MAX_TOKENS)
  • Add ad filter patterns (AD_TITLE_PREFIXES, AD_TITLE_KEYWORDS, AD_LINK_KEYWORDS)
  • Limit stories per section (MAX_NEWS_STORIES, MAX_TECH_STORIES, default: 15)

Security Notes

  • No API keys in code -- all secrets via GitHub encrypted secrets
  • GITHUB_TOKEN is auto-scoped per job, expires after the run
  • Minimal permissions: only contents: write (for sent.json) and models: read
  • No external services beyond Telegram API and GitHub Models
  • Timeout: workflow limited to 5 minutes, feed fetches limited to 15 seconds each

About

Automated German tech news digest with AI teasers, delivered to Telegram via GitHub Actions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages