From 50c25fd35c82a8397abb49b1f6a1657f67c9dd1d Mon Sep 17 00:00:00 2001 From: Mathias Micheel <49622130+buerviper@users.noreply.github.com> Date: Mon, 17 Jul 2023 15:00:40 +0200 Subject: [PATCH] python --- images/{ => descriptions}/suikoden_1_camille_talk_big.yml | 0 run.py | 6 +++++- 2 files changed, 5 insertions(+), 1 deletion(-) rename images/{ => descriptions}/suikoden_1_camille_talk_big.yml (100%) diff --git a/images/suikoden_1_camille_talk_big.yml b/images/descriptions/suikoden_1_camille_talk_big.yml similarity index 100% rename from images/suikoden_1_camille_talk_big.yml rename to images/descriptions/suikoden_1_camille_talk_big.yml diff --git a/run.py b/run.py index 75c9c93..2c4b176 100644 --- a/run.py +++ b/run.py @@ -1,4 +1,6 @@ from mastodon import Mastodon +import os, random + # Create an instance of the Mastodon class mastodon = Mastodon( @@ -7,4 +9,6 @@ ) # Post a new status update -mastodon.status_post('Testititest') +image = random.choice([x for x in os.listdir(".\images") if os.path.isfile(os.path.join(".\images", x))]) + + Mastodon.media_post(image, mime_type=None, description=None, focus=None, file_name=None, thumbnail=None, thumbnail_mime_type=None, synchronous=False)[source]