Last active
May 1, 2024 06:55
-
-
Save dewomser/4edba1be1f73c8ed1c785a2244ad374a to your computer and use it in GitHub Desktop.
mastodon toot a photostream make and destroy toots in a time intervall
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!/bin/bash | |
#crontab | |
#for crontab use always full path or EXPORT | |
#crontabline : */15 * * * * /full/path/toot_a_photostream.sh >/full/path/error.txt 2>&1 | |
fullpath_dir="/home/foo/bin/stream" | |
fullpath_toot="/usr/bin/toot" | |
source_url="https://webcams.lolo.de/Webcam1/webcam/current.jpg" | |
toottext="your txt $(date +%H:%M) . Every 15 minutes a snapshot!" | |
tootid="$(cat $fullpath_dir/toot_id.txt)" | |
#sleep 100 | |
if [ -z "$tootid" ]; then | |
echo "still no ID" | |
else | |
$fullpath_toot delete $tootid | |
fi | |
sleep 1 | |
/usr/bin/wget --no-use-server-timestamps $fullpath_dir/$(date +%m_%d_%y) $source_url -O $fullpath_dir/$(date +%m_%d_%y)/$(date +%H_%M).jpg | |
tooturl="$(echo "$toottext"| $fullpath_toot post --media $fullpath_dir/$(date +%m_%d_%y)/$(date +%H_%M).jpg)" | |
echo "${tooturl##*/}" > $fullpath_dir/toot_id.txt |
Needs command line tool "toot"
This is a gist , no help, nothing at all, do with it what you like.
update 01.05.2024 Jetzt mit Variablen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
initial