RSS/JSON generator for telegram
Get posts via my TelegramApiServer and output them as RSS or JSON.
Features
- Fast async swoole server
- Use as micro-service to access telegram api
- Get any public telegram posts from groups as json or RSS
- fail2ban, RPM limits, IP blacklist
- Full media support. Access any media from messages via direct links.
Proposed Architecture
Installation
-
Swoole extension required: Install swoole
-
Install and run my telegram client
-
Clone this project
-
composer install
Optional:
-
Create .env from .env.example
-
Edit .env if needed
-
Use supervisor to monitor and restart swoole servers. Example of
/etc/supervisor/conf.d/telegram_rss.conf
:[program:telegram_rss] command=/usr/bin/php /home/admin/web/tg.i-c-a.su/TelegramRSS/server.php numprocs=1 directory=/home/admin/web/tg.i-c-a.su/TelegramRSS/ autostart=true autorestart=true stdout_logfile=none redirect_stderr=true
-
Nginx config
server { listen %ip%:443 ssl; server_name tg.i-c-a.su www.tg.i-c-a.su; ssl_certificate /home/admin/conf/web/ssl.tg.i-c-a.su.pem; ssl_certificate_key /home/admin/conf/web/ssl.tg.i-c-a.su.key; location / { proxy_set_header Host $http_host; proxy_set_header SERVER_PORT $server_port; proxy_set_header REMOTE_ADDR $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; fastcgi_param REMOTE_ADDR $http_x_real_ip; proxy_http_version 1.1; proxy_set_header Connection "keep-alive"; proxy_pass http://127.0.0.1:9504; } }
Usage
-
Run client
-
Check that address and port of client are correct in .env file
-
run rss server
php server.php
Examples:
-
Custom limit: https://tg.i-c-a.su/rss/breakingmash?limit=50
Maximum - 100 posts
-
Pagination: https://tg.i-c-a.su/rss/breakingmash/2
Default address of rss server is http://127.0.0.1:9504/
Contacts
- Telegram: @xtrime
- Email: alexander(at)i-c-a.su
Donations
- BTC: 1BE1nitXgEAxg7A5tgec67ucNryQwusoiP
- ETH: 0x0e2d369E28DCA2336803b9dE696eCDa50ff61e27