A high-performance Cloudflare Worker that bridges social media platforms to RSS, drives a powerful Telegram bot for automated multi-platform feed distribution and media downloading, and includes a React admin dashboard.
Converts Instagram content into clean RSS 2.0 XML. Supports multiple content types:
- User Feeds:
@username - Hashtags:
#hashtag - Locations: Location ID based feeds
- Filtering: Filter by media type (photo, video, album)
- Direct Links: Option to use direct CDN URLs for media
A feature-rich bot to manage your feeds and subscriptions:
- Subscription Management: Subscribe/unsubscribe Telegram channels to Instagram profiles, TikTok users, or any RSS/Atom feed URL.
- Automated Posting: Periodic checking of feeds (every 5 min via Cron) and automatic posting to configured channels.
- Multi-Platform Media: Downloads and sends media from 9+ platforms β Instagram, TikTok, Twitter/X, YouTube, Facebook, Threads, SoundCloud, Spotify, Pinterest.
- Customizable Formatting: Per-channel and per-source formatting settings (author display, media toggles, source links, notification muting, hashtags, custom headers/footers).
- Telegraph Publishing: Long posts automatically published to Telegraph and linked in Telegram.
- AI Summarization: Concise Arabic summaries generated via Cloudflare AI Gateway, configurable per channel and per source.
- Fallback Logic: Smart handling of large media files with automatic fallback to "Thumbnail + Link" or "Skip" modes.
- Failed Posts Log: Admin interface to view and manage posts that failed to send due to Telegram limits.
A Tailwind v4-powered dashboard served directly from the Worker as static assets:
- Browse and manage feeds, subscriptions, and channel configs.
- View AI settings and post logs.
- Served at the Worker URL (or custom domain
rss.feed.engdawood.com).
An AI-accessible MCP server at /mcp backed by a Durable Object with SQLite β exposes tools for feed management, browsing, posting, and memory.
- A Cloudflare account with Workers, KV, D1, and Queues enabled.
- A Telegram Bot Token (from @BotFather).
- Instagram Session Cookies (
sessionidandds_user_id) for authenticated fetching. pnpminstalled globally (npm install -g pnpm).
git clone https://github.com/EngDawood/RSS-Bridge.git
cd rss-bridge
pnpm installCreate required resources and note their IDs for wrangler.jsonc:
# KV namespace
npx wrangler kv namespace create CACHE
# D1 database
npx wrangler d1 create rss-reader
# Queues
npx wrangler queues create rss-bot-fetch-queue
npx wrangler queues create rss-bot-send-queueUpdate the kv_namespaces, d1_databases, and queues IDs in wrangler.jsonc with the values from the commands above.
# Local development
npx wrangler d1 migrations apply rss-reader --local
# Production
npx wrangler d1 migrations apply rss-reader --remoteThere are four migrations (0001_init.sql through 0004_ai_model_prompt.sql).
Use Wrangler to securely set your sensitive credentials:
npx wrangler secret put TELEGRAM_BOT_TOKEN
npx wrangler secret put TELEGRAM_WEBHOOK_SECRET
npx wrangler secret put IG_SESSION_ID
npx wrangler secret put IG_DS_USER_ID
npx wrangler secret put MCP_AUTH_TOKEN
npx wrangler secret put AI_GATEWAY_TOKEN
npx wrangler secret put FOLO_WEBHOOK_SECRET # optionalpnpm deploypnpm dev # Backend (port 8787) + Frontend (port 5173) concurrently
pnpm build # Typecheck and build the React app
pnpm run cf-typegen # Regenerate TypeScript types from wrangler.jsonc
pnpm lint # Lint the frontend source
pnpm test # Run vitestGET /instagram?u=<username>β Fetch user feed.GET /instagram?h=<hashtag>β Fetch hashtag feed.GET /instagram?u=<username>&media_type=videoβ Filter byall|video|picture|multiple.GET /instagram?u=<username>&direct_links=trueβ Use direct CDN URLs.GET /healthβ Health check.GET /test-bridges[/:u]β Test RSS-Bridge / RSSHub instances.
/start//helpβ Show usage information./add @channelβ Register a new Telegram channel for management./channelsβ List all registered channels./sub @channel <source>β Subscribe a channel to a source (IG username, TikTok ID, or RSS URL)./unsub @channel <source>β Unsubscribe from a source./statusβ Show current subscriptions and their status./formatβ Open the interactive formatting settings menu./aiβ Configure AI summarization (toggle, set model, edit prompt, test)./test [source] [count]β Manually test a feed source (supports ForceReply interactive flow)./cancelβ Cancel the current interactive flow.
workers/ # Cloudflare Worker (entry: workers/index.ts)
βββ index.ts # Hono app, fetch/scheduled/queue handlers
βββ constants.ts # Instagram API endpoints, KV key prefixes, format defaults
βββ queue-handler.ts # processFetchTask + processSendTask
βββ cron/
β βββ check-feeds.ts # Enqueues FEED_FETCH_QUEUE tasks per subscription
β βββ refresh-feeds.ts # Refreshes feed metadata in D1
βββ db/
β βββ d1.ts # All D1 helpers (feeds, items, chats, notes, post_log, config, AI)
βββ mcp/
β βββ index.ts # RSSReaderMCP (McpAgent DO) β served at /mcp
β βββ tools.ts # MCP tool registrations backed by D1
βββ routes/
β βββ action-api.ts # POST /api/action and POST /api/chat
β βββ folo.ts # POST /folo webhook
β βββ instagram.ts # GET /instagram RSS endpoint
β βββ setup.ts # GET /telegram/setup
β βββ telegram.ts # POST /telegram/webhook
β βββ test-bridges.ts # GET /test-bridges, /test-rssbridge, /test-rsshub
βββ services/
β βββ ai-summarizer.ts # Cloudflare AI Gateway summarization
β βββ chat-agent.ts # OpenAI-compatible chat agent
β βββ feed-fetcher.ts # Generic RSS/Atom parser (Cheerio)
β βββ instagram-client.ts # Instagram RSS-Bridge fetching
β βββ media-downloader.ts # Multi-platform media downloader (btch API)
β βββ rss-builder.ts # RSS 2.0 XML builder
β βββ source-fetcher.ts # Multi-platform source routing
β βββ user-resolver.ts # Instagram usernameβID resolution + KV cache
β βββ telegram-bot/ # grammY bot (commands, callbacks, handlers, views)
βββ utils/
βββ cache.ts # KV cache helpers
βββ headers.ts # HTTP header utilities
βββ media-enrichment.ts # enrichFeedItems orchestration
βββ media.ts # Media type detection and processing
βββ telegram-format.ts # Caption/message formatting
βββ telegraph.ts # Telegraph publishing integration
βββ text.ts # Text utilities
βββ url-detector.ts # Platform URL detection
app/ # React admin dashboard (Vite + Tailwind v4)
βββ src/App.tsx # Entire dashboard UI (~115 KB single file)
βββ dist/ # Built assets served by the Worker
shared/
βββ types.ts # Shared TypeScript types
migrations/ # D1 migrations (applied manually)
βββ 0001_init.sql
βββ 0002_chats_notes.sql
βββ 0003_ai_summary.sql
βββ 0004_ai_model_prompt.sql
| Feature | Binding | Purpose |
|---|---|---|
KV (CACHE) |
CACHE |
Feed XML cache, user ID cache, channel configs, sent-item dedup |
D1 (rss-reader) |
DB |
Feeds, items, chats, notes, post_log, config, AI settings |
| Durable Object | RSSReaderMCP |
SQLite-backed MCP agent |
| Queue | FEED_FETCH_QUEUE |
Feed fetching + dedup + AI summary (batch 10) |
| Queue | TELEGRAM_SEND_QUEUE |
Telegram dispatch with retry (batch 1) |
| Static Assets | ASSETS |
Serves app/dist |
The vars section allows you to customize runtime behavior:
| Var | Default | Purpose |
|---|---|---|
USER_ID_CACHE_TTL |
86400 |
Instagram user ID cache duration (seconds) |
FEED_CACHE_TTL |
900 |
Feed XML cache TTL (seconds) |
ADMIN_TELEGRAM_ID |
β | Your Telegram user ID (restricts bot access) |
WORKER_URL |
β | Public URL of your deployed Worker |
DEFAULT_AI_MODEL |
nvidia/llama-3.1-nemotron-70b-instruct |
AI model for feed summarization |
CHAT_AI_MODEL |
google/gemini-2.0-flash |
AI model for the chat agent |
Private Project. All rights reserved.