Python script to get the content of my public toots on my mastodon instance, via rss and then cross post them to my microblog for long term archival
The script will gets RSS entries from a mastodon account feed and create text files in the current directory, which you can then give to Hugo to process
- You have a mastodon account and its url
- This script is tailored to a Hugo microblog running J N Josh’s internet-weblog theme
- This works if, you work on the blog, locally. You need to
rsync
orgit-push
once done. If your whole workflow is cloud based, this probably won’t do it for you
The script also does no verification of any sort. for e.g., to see, if the feed is malformed.
Use at your own risk.
Media other than photos, don’t work for now.
- In a virtualenv, install requirements with
pip
.
I use Python 3.11.
python -m pip install -r requirements.txt
-
Copy
settings.py.example
tosettings.py
and updatemastodon_feed_url
,post_path
andimage_path
. -
Run the script to pull toots and push to the microblog.
python mastodon-to-moi.py