Posting text and images to Mastodon
Tutorial – Mastodon
Creating a custom application that toots text to Mastodon (the Fediverse's version of Twitter) is simple and straightforward. But we can mix it up by adding images and video, scheduling posts, and changing privacy settings.
If you haven't read the prior article in this series [1], you may want to do that now. There, you will learn how to read from a Mastodon feed and print out the toots (the name Mastodon gives its posts) onto the command line. You can do that quite easily with Python, because the API for Mastodon is open and well documented, and also because there is a comprehensive Python wrapper [2] that makes building ad hoc clients a breeze.
In this article, we're going a step further, and you will see how to create an app that posts your toots. Before you start, and just in case you haven't already, install the Mastodon.py
module with
pip install Mastodon.py
[...]
Buy this article as PDF
(incl. VAT)