A self-contained, privacy-focused RSS feed generator for Telegram public channels. This lightweight PHP application enables users to convert any public Telegram channel into a standard RSS 2.0 feed without relying on external APIs or third-party services.
This application prioritizes user privacy and data security through several architectural decisions:
- Self-Hosted Architecture: All processing occurs on your own server, ensuring complete control over data handling and eliminating dependence on external services that might track usage or store channel information
- No External API Dependencies: The application directly scrapes Telegram's public web interface, meaning no third-party RSS services have access to your channel subscriptions or reading habits
- Zero Data Collection: No user data, channel preferences, or usage statistics are collected, stored, or transmitted to any external parties
- Public Content Only: Designed exclusively for public Telegram channels, ensuring compliance with Telegram's terms of service and respecting content access permissions
- Input Sanitization: Comprehensive validation and sanitization of channel names prevent injection attacks and ensure only legitimate channels are processed
- Secure Communication: All requests to Telegram use HTTPS with SSL/TLS verification enabled, protecting data in transit
- Zero Configuration: Single-file application with no external dependencies beyond standard PHP extensions
- Universal Compatibility: Works with any RSS reader (Feedly, Inoreader, NewsBlur, etc.)
- Multiple Input Formats: Accepts channel names in various formats (@username, t.me/username, full URLs)
- Clean, Responsive Interface: Modern web UI built with Tailwind CSS for easy feed generation
- RSS 2.0 Standard Compliance: Generates feeds that work seamlessly with all RSS readers
- Real-Time Updates: Feeds update automatically when your RSS reader requests new content
- Lightweight and Fast: Minimal resource footprint with efficient HTML parsing
- Rich Content Preservation: Maintains text formatting including bold, italic, and links
- AJAX Support: Smooth user experience with asynchronous form handling
- Comprehensive Error Handling: Clear feedback for invalid channels or connectivity issues
- PHP 7.4 or higher
- PHP Extensions (typically included by default):
libxmldommbstring
- Web server (Apache, Nginx, or built-in PHP server)
- Internet connectivity to access Telegram's public web interface
-
Download the application:
wget https://raw.githubusercontent.com/xsukax/xsukax-Telegram-RSS-Feed-Generator/main/telegram-rss.php
-
Deploy to your web server:
# For Apache sudo cp telegram-rss.php /var/www/html/ # For Nginx sudo cp telegram-rss.php /usr/share/nginx/html/
-
Set appropriate permissions:
sudo chmod 644 telegram-rss.php sudo chown www-data:www-data telegram-rss.php
-
Access the application: Open your browser and navigate to
http://your-domain.com/telegram-rss.php
-
Clone or download the file:
git clone https://github.com/xsukax/xsukax-Telegram-RSS-Feed-Generator.git cd xsukax-Telegram-RSS-Feed-Generator -
Start the PHP server:
php -S localhost:8000
-
Access the application: Open your browser to
http://localhost:8000/telegram-rss.php
-
Create a Dockerfile:
FROM php:8.2-apache COPY telegram-rss.php /var/www/html/ RUN chmod 644 /var/www/html/telegram-rss.php EXPOSE 80
-
Build and run:
docker build -t telegram-rss-generator . docker run -d -p 8080:80 telegram-rss-generator
graph TD
A[Open Application in Browser] --> B[Enter Telegram Channel]
B --> C{Valid Channel Format?}
C -->|Yes| D[Click Generate RSS Feed]
C -->|No| E[Show Error Message]
E --> B
D --> F[Application Fetches Channel Data]
F --> G{Channel Exists?}
G -->|Yes| H[Display RSS Feed URL]
G -->|No| I[Show Error Message]
I --> B
H --> J[Copy RSS URL]
J --> K[Add to RSS Reader]
K --> L[Enjoy Updates!]
-
Open the Application: Navigate to the application URL in your web browser
-
Enter Channel Information: In the input field, enter the Telegram channel using any of these formats:
- Channel username:
channelname - With @ symbol:
@channelname - Short URL:
t.me/channelname - Full URL:
https://t.me/channelname - Preview URL:
https://t.me/s/channelname
- Channel username:
-
Generate Feed: Click the "Generate RSS Feed" button
-
Copy RSS URL: Once generated, copy the RSS feed URL using the "Copy" button
-
Add to RSS Reader: Paste the copied URL into your preferred RSS reader application
| Format | Example | Valid |
|---|---|---|
| Username only | technews |
β |
| With @ prefix | @technews |
β |
| t.me URL | t.me/technews |
β |
| Full URL | https://t.me/technews |
β |
| Preview URL | https://t.me/s/technews |
β |
You can also access feeds directly via URL without using the web interface:
http://your-domain.com/telegram-rss.php?feed=channelname
This is useful for programmatic access or direct RSS reader configuration.
flowchart LR
A[User Browser] --> B[telegram-rss.php]
B --> C{Request Type?}
C -->|Web UI| D[Display Form]
C -->|RSS Feed| E[Fetch Channel Data]
E --> F[Telegram t.me/s/]
F --> G[Parse HTML]
G --> H[Generate RSS XML]
H --> I[Return Feed]
I --> A
D --> J[User Input]
J --> K[AJAX Request]
K --> E
The application includes configurable constants at the top of the file:
define('POSTS_PER_FEED', 50); // Number of posts to include in each feed
define('USER_AGENT', 'Mozilla/5.0...'); // User agent for Telegram requestsTo customize:
- Open
telegram-rss.phpin a text editor - Modify the constant values
- Save the file
Issue: "Could not fetch channel data"
- Solution: Verify the channel is public and exists. Private channels are not supported.
Issue: "Invalid channel name format"
- Solution: Ensure the channel name is 5-32 characters and contains only letters, numbers, and underscores.
Issue: Feed not updating in RSS reader
- Solution: Check your RSS reader's refresh interval settings. Most readers cache feeds for 15-60 minutes.
Issue: PHP errors about missing extensions
- Solution: Install required PHP extensions:
sudo apt-get install php-xml php-mbstring
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit your changes:
git commit -am 'Add new feature' - Push to the branch:
git push origin feature-name - Submit a pull request
Please ensure your code follows existing style conventions and includes appropriate comments.
This project is licensed under the GNU General Public License v3.0.
- Built with standard PHP libraries (DOMDocument, DOMXPath)
- Styled with Tailwind CSS
- Inspired by the need for privacy-respecting RSS solutions
For issues, questions, or suggestions:
- Open an issue on GitHub
- Check existing issues for solutions to common problems
Note: This application only works with public Telegram channels. Private channels and groups are not supported due to Telegram's access restrictions.