Skip to content

Instantly share code, notes, and snippets.

@dewomser
Last active May 1, 2024 06:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dewomser/4edba1be1f73c8ed1c785a2244ad374a to your computer and use it in GitHub Desktop.
Save dewomser/4edba1be1f73c8ed1c785a2244ad374a to your computer and use it in GitHub Desktop.
mastodon toot a photostream make and destroy toots in a time intervall
!/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
@dewomser
Copy link
Author

dewomser commented May 1, 2023

initial

@dewomser
Copy link
Author

dewomser commented May 1, 2023

Needs command line tool "toot"

This is a gist , no help, nothing at all, do with it what you like.

@dewomser
Copy link
Author

dewomser commented May 1, 2024

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