sttvld / TelegramRSS

Convert telegram posts to RSS or json in swoole server

Home Page:https://tg.i-c-a.su

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TelegramRSS

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

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

Donations

  • BTC: 1BE1nitXgEAxg7A5tgec67ucNryQwusoiP
  • ETH: 0x0e2d369E28DCA2336803b9dE696eCDa50ff61e27

About

Convert telegram posts to RSS or json in swoole server

https://tg.i-c-a.su

License:MIT License


Languages

Language:PHP 88.1%Language:HTML 11.9%