An open API service indexing awesome lists of open source software.

https://github.com/SailorMax/twitter2telegram

Copy tweets from Twitter channel to Telegram channel
https://github.com/SailorMax/twitter2telegram

telegram twitter

Last synced: over 1 year ago
JSON representation

Copy tweets from Twitter channel to Telegram channel

Awesome Lists containing this project

README

          

# Twitter to Telegram

Copy tweets from one Twitter channel to Telegram channel. Example of the result you can found [here](https://t.me/w_humor_mirror).

## Peculiarities
- work via Twitter API v2 (Essential mode)
- work via Telegram Bot API
- standalone solution

## Warning
After start usage do not delete `[#!n82an48]`-like ID from target Telegram channel description! By this ID the script track last imported tweet. If you remove it, import starts "from begin" (100 last tweets).

## Guide
1. Get Twitter API Bearer Token from [here](https://developer.twitter.com/)
2. Go to [@BotFather](https://t.me/botfather) in Telegram and create a Bot to get `Access Token`
3. Setup to Bot for target channel next permissions: `Change channel info` and `Post messages`
4. Create and fill `.env` based on `.env.skel` (for local use) OR copy it's variables to `Settings/Secrets/Actions` (GitHub) or `Config Vars` (Heroku)
5. For local use run the script by executing:
```sh
$ pip3 install -r requirements.txt
$ python3 twitter2telegram.py
# or `python3 repeater.py 60` to copy new tweets each 60 minutes
```

## Deploying to Heroku
```sh
$ heroku create
$ git push heroku main
$ heroku open
```
or

[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)