Monitor the following
, tweet
, and like
profile
of a Twitter user and send the changes to the telegram channel.
Data is crawled from Twitter web’s GraphQL API.
(Due to the unstable return results of Twitter Web's following
API, accounts with more than 100 followings are not recommended to use following
monitor.)
https://t.me/twitter_monitor_menu
(Requires python >= 3.10)
Clone code and install dependent pip packages
git clone https://github.com/ionic-bond/twitter-monitor.git
cd twitter-monitor
pip3 install -r ./requirements.txt
-
Create a Telegram bot and get it's token:
-
Unofficial Twitter account auth:
You need to prepare one or more normal twitter accounts, and then use the following command to generate auth cookies
python3 main.py generate-auth-cookie --username "{username}" --password "{password}"
-
First make a copy from the config templates
cp ./config/token.json.template ./config/token.json cp ./config/monitoring.json.template ./config/monitoring.json
-
Edit
config/token.json
-
Fill in
telegram_bot_token
-
Fill in
twitter_auth_username_list
according to your prepared Twitter account auth -
Now you can test whether the tokens can be used by
python3 main.py check-tokens
-
-
Edit
config/monitoring.json
(You need to fill in some telegram chat id here, you can get them from https://t.me/userinfobot and https://t.me/myidbot)
-
If you need to view monitor health information (starting summary, daily summary, alert), fill in
maintainer_chat_id
-
Fill in one or more user to
monitoring_user_list
, and their notification telegram chat id, weight, which monitors to enable. The greater the weight, the higher the query frequency. The profile monitor is forced to enable (because it triggers the other 3 monitors), and the other 3 monitors are free to choose whether to enable or not -
You can check if your telegram token and chat id are correct by
python3 main.py check-tokens --telegram_chat_id {your_chat_id}
-
python3 main.py run
Flag | Default | Description |
---|---|---|
--interval | 15 | Monitor run interval |
--confirm | False | Confirm with the maintainer during initialization |
--listen_exit_command | False | Liten the "exit" command from telegram maintainer chat id |
--send_daily_summary | False | Send daily summary to telegram maintainer |
Telegram: @ionic_bond