Quick and dirty way to periodically check public telegram channel's preview URL and throw notifications on new posts.
Can send desktop notifications via libnotify and perform text-to-speech conversion via python3-gtts and ffmpeg.
No telegram account or api_id required.
- curl
- libnotify (optional, for desktop notifications)
- python3-gtts, ffmpeg (optional, for text-to-speech conversion)
Install the dependencies, if needed:
sudo apt install curl libnotify python3-gtts ffmpeg
Make the .local/bin directory if not exists (optional, just for launching the script without specifying full path)
mkdir ~/.local/bin
Download the script and make it executable
cd ~/.local/bin
wget https://raw.githubusercontent.com/noisedsn/telegram-checker/refs/heads/main/tgchecker.sh
chmod u+x tgchecker.sh
Usage: tgchecker.sh [OPTIONS] https://t.me/s/channel_name
Options:
-t, --timeout <sec> Timeout between checks, seconds [default: 30]
-n, --notify Throw desktop notification
-v, --voice Perform text-to-speech conversion
-l, --lang <lang> IETF language tag. Language to speak in. [default: en]
-i, --intro <text> Prepend a message to be voiced before main text
-m, --maxlength <words> Limit the text-to-speech length [default: unlimited]
-c, --cut <text> Append a message to be voiced if long text was truncated
-h, --help Show this help
On the first launch it will show 5 last messages. It may require quite a time to voice them. So, it's recommended to try without notifications first:
tgchecker.sh https://t.me/s/channel_name
Check every 60 seconds, throw desktop notifications and perform text-to-speech in ukrainian with intro text (maximun 15 words):
tgchecker.sh -t 60 -n -v -l uk -i "Нове сповіщення:" https://t.me/s/channel_name -m 15 -c "... повідомлення скорочено"
