Skip to content

ilbuonmarcio/tgnotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tgnotify

A very simple & useful Telegram notification agent for the command line:

you pipe it -> you get it!

Usage examples

For sending a message to your notification bot

echo "WOW\!" | python main.py

For sending you the disk usage

df -h | python main.py

For sending uptime

uptime --pretty | python main.py

For sending the packages available to update your Arch Linux system

yay -Sy &> /dev/null && yay -Qu | python main.py

For getting a notification about your server up and running

echo "$(hostname) is up and running\!" | python main.py

...or simply everything you can pipe!

Check the scripts folder for some examples!

Installation

python -m pip install virtualenv
python -m virtualenv venv
source ./venv/bin/activate
python -m pip install -r requirements.txt
cp .env.example .env
vim .env # Insert your Botfather-generated token and your Telegram user chat id here!
echo "That's my first message\!" | python main.py

As crontab service

Arch example

SHELL=/usr/bin/zsh
0 10 * * * source /root/tgnotify/venv/bin/activate && /root/tgnotify/scripts/short_arch.sh | python /root/tgnotify/main.py && deactivate

License

This software is licensed under the WTFPL License. See LICENSE file for more information.

About

Pipe shell output straight to Telegram!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published