Simple Twitter to Telegram script based on tweepy
Make sure python3 and git installed on your system
git clone https://github.com/sinaebrahimi1/twitter2telegram.git
and just install the requirements: pip3 install -r requirements.txt
Twitter configs:
Put the page ids that you want to be monitored in follows
as a list like follows = ["123456", "54321"]
.
(You can extract user_ids from http://gettwitterid.com.)
Get Twitter API Authentication Credentials from https://developer.twitter.com/ and place them in Twitter Configs
section:
1. Consumer key
2. Consumer secret
3. Access token
4. Access secret
Telegram configs:
-
You have to create a channel ant put its id in
TWEET_CH
like the example. (to get channel_id, forward a message from channel to @userinfobot) -
Create a new bot with @BotFather and place it's token in
BOT_API
. -
Add the bot to the channel and make it channel admin.
python3 main.py
if you want to prevent crashes or things like that, just run this command:
while true; do python3 main.py; done
- email: ebrahimisina78@gmail.com
- telegram: @Thunderstrack