Send stdin as a Telegram message to a specific user.
- Telegram bot (API token)
- python
- python-requests
Set API token and chat ID in notify.py
.
Make sure notify.py
is executable.
Run the following command to send a single Telegram message:
echo Hello world | ./notify.py
Alternatively, put notify.ph
in $PATH
and pipe the output
of any command to notify_loop.sh
:
some-command | ./notify_loop.sh
That will send one Telegram message per input line.