Last active
May 14, 2024 03:46
-
-
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 * * * * /home/user_name/bin/stream_ordner/toot_a_photostream.sh >/home/user_name/bin/stream_ordner/error.txt 2>&1 | |
fullpath_dir="/home/foo/bin/stream" | |
fullpath_toot="/usr/bin/toot" | |
mkdir -p $fullpath_dir/"$(date +%m_%d_%y)" | |
source_url="https://webcams.foo_bar.de/Webcam1/webcam/current.jpg" | |
toottext="Mein Text $(date +%H:%M) . Alle 15 Minuten ein Schnappschuss!" | |
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
03.05.2024 dran rumgemurkst
Nochmal dran rumgemurkst. Jetzt wird automatisch ein Ordner für die Fotos erzeugt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
initial