This package monitors the number of participants in a telegram channel and can post gains/losses updates to twitter
Project description
Telegram Updates Tweets
This package monitors the number of participants in a telegram channel and can post gains/losses updates to twitter. It requires a twitter API key and telegram API key.
Installation
Use the package manager pip to install telegram_updates_tweets.
pip install telegram_updates_tweets
Usage
The package is configured with a bunch of options.
python -m telegram_updates_tweets --tweet-losses 100 --twitter-key OopN17481741985zgmRg0FVAOzC --twitter-secret VWyvs87I091508915HWAJDdb4XlwOLPkQXOTPbcETEV8HlvmnCx --twitter-access-token 1341085719874981434437-1zh50lhr3WEJhjfabfhdK8oYGrSh3eW --twitter-access-token-secret 5jGpCn79Z8714871kjlafjagaXr7VKeNEKWQVzzU --telegram-api-id 2015515 --telegram-api-hash b7dae63689015901efeffc69 --mongodb 127.0.0.1:27017 --telegram-channel-name CHANNELNAME --tweet-loss-template 'Der Telegram Kanal hat {loss_step} Leser verloren und ist jetzt bei {count}' --tweet-graph-template '24h Bericht, aktuelle Anzahl der Leser ist {count}, Änderung {total_change:+d} Leser' --tweet-graph 20 --tweet-graph-img-template 'Innerhalb der letzten {hours} Std.: {total_change:+d} Leser'
Options
Usage: python -m telegram_updates_tweets [OPTIONS]
Connects to telegram as a user and checks every 60minutes the subscriber
count of the given channel. It allows to tweet gains and/or losses with
additional info. It has a small web interface to configure access to
social media.
Options:
--tweet-gains INTEGER Deactivated if <=0, otherwise describes the
step. Example: 100 -> tweet at 1900, 2000,
2100, ...
--tweet-losses INTEGER Deactivated if <=0, otherwise describes the
step. Example: 100 -> tweet at 2100, 2000,
1900, ...
--tweet-loss-template TEXT This template will be formatted and posted
on loss
--tweet-gain-template TEXT This template will be formatted and posted
on gain
--tweet-graph INTEGER Deactivated if <0, otherwise 0..23 specifies
the time when to post a 24h summary graph
(requires mongodb)
--tweet-graph-template TEXT This template will be formatted and posted
if --tweet-graph is specified
--tweet-graph-img-template TEXT
This template will be formatted and used in
the image if --tweet-graph is specified
--twitter-key TEXT Also called API key, is created by the
twitter app
--twitter-secret TEXT The secret of the twitter app
--twitter-access-token TEXT The access token of the oauth procedure
--twitter-access-token-secret TEXT
The secret of the oauth access token
--telegram-api-id INTEGER The number created by telegram
--telegram-api-hash TEXT The api hash created by telegram
--telegram-channel-name TEXT The name of the channel of interest
--mongodb TEXT IP:PORT of the mongo db, if not set, no data
will be logged
--help Show this message and exit.
Development
- After cloning this repo execute
git config core.hooksPath hooks
in the root directory. - Install poetry https://python-poetry.org/docs/
poetry config settings.virtualenvs.in-project true
poetry install
poetry shell
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for telegram_updates_tweets-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcdf7ec5f605712301701f9d9b841fc8530145d05cce455630d901cafc48ff14 |
|
MD5 | 4590029018b13298d6d24639be6241dd |
|
BLAKE2b-256 | b1d8bbba4cba30bd3251f32fca9d025830f5d15842c57632a0cbb8f20602b95b |
Close
Hashes for telegram_updates_tweets-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06a9b76da6b2bd3999ea2158b0371b48d7ee95026023ef14ba0b820901b85f99 |
|
MD5 | e13048af7c6e7bb890a937bee45a0088 |
|
BLAKE2b-256 | 19d504cfc97d23f590ef0095d30bb4cda4d81f02398fff8dbea37aca431c6ce2 |