Small python app that publishes a randomly selected image from a local folder to mastodon
- scan a given directory (and recursive all subdirectories) for image files and select one random image
- post this image to mastodon, uses file name as posted text
- up to four images per toot
- some sort of intelligent text replacement (from "1991-10" in the filename it makes "10/1991" in the post)
- create empty marker file for used image (ends with ".used.real"), so this image will not be used again until you delete this marker file
- optional: simulation mode to check what the app would do
-
(clone repository)
-
create a file ".env" and enter these lines (use your own URL and mastodon app token):
MASTODON_TOKEN=<your token here MASTODON_URL=<your mastodon server url here> #optional choose one ore more Hashtags that will be appended at the end of the post: HASHTAGS=#Retrogaming #Games
... more to come soon ...
If you want to use more than one image in a tweet (e.g. if you have multiple files/pages for one thing) name them (up to four) like this:
- myfile__1.jpg
- myfile__2.jpg
- myfile__3.jpg
- myfile__4.jpg