Skip to content
Convert telegram posts to RSS or json in swoole server
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Media types fix May 11, 2019
.env.example .env format update & code review. Need to recreate .env! Mar 19, 2019
.gitignore
LICENSE Initial commit Feb 4, 2019
README.md Readme update Mar 19, 2019
bootstrap.php
composer.json Non blocking http client & coroutines Mar 18, 2019
composer.lock sleep fix May 5, 2019
config.php .env format update & code review. Need to recreate .env! Mar 19, 2019
favicon.ico Media size limit & favicon Feb 24, 2019
index.html Offset and pagination Mar 15, 2019
server.php

README.md

TelegramRSS

RSS/JSON generator for telegram

Get posts via my TelegramSwooleClient 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

Proposed Architecture

Installation

  1. Swoole extension required: Install swoole

  2. Install and run my telegram client

  3. Clone this project

  4. composer install

    Optional:

  5. Create .env from .env.example

  6. Edit .env if needed

  7. 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
    
  8. 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

  1. Run client

  2. Check that address and port of client are correct in .env file

  3. run rss server php server.php

    Examples:

    Default address of rss server is http://127.0.0.1:9504/

Contacts

  • Telegram: @xtrime
  • Email: alexander(at)i-c-a.su
You can’t perform that action at this time.