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
- Host: GitHub
- URL: https://github.com/SailorMax/twitter2telegram
- Owner: SailorMax
- License: mit
- Created: 2022-02-27T08:34:52.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-02T12:00:37.000Z (over 3 years ago)
- Last Synced: 2024-10-23T22:20:38.547Z (over 1 year ago)
- Topics: telegram, twitter
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
[](https://heroku.com/deploy)