The Intrepid Toot Archiver is a small CLI app that I use to create and manage an archive of my public toots (toots / posts) from a Mastodon server on the fediverse. Specifically my accounts at theblower.au.
Archived statuses are the source of content for the content archive. The content archive contains Markdown files that can be used for content by static site generates such Hugo, which is my preferred framework.
The app has the following commands:
Command | Description |
---|---|
lookup-user | Lookup the details of a user on the Mastodon server |
update-archive | Download new statuses from the server |
update-content | Update the content archive |
update-photos | Update the content archive with photo posts |
delete-status | Delete a status and related media from the archive |
help | Display brief help for a command |
The app has the following options:
Short option | Long option | Description |
---|---|---|
-d | --debug | Output environment variable content |
-f | --force | Overwrite files in the status or content archive |
-t | --tag | Only add new statuses with the matching tag |
Configuration uses environment variables. They can be supplied by a .env file or via a shell script. The environment variables are:
Variable | Description |
---|---|
ITA_HOST | The name of the Mastodon host |
ITA_USERID | The unique ID of the user |
ITA_USERNAME | The username of the account on the host |
ITA_ARCHIVE_PATH | The full path to the status archive |
ITA_MEDIA_ARCHIVE_PATH | The full path to the media archive |
ITA_CONTENT_ARCHIVE_PATH | The full path to the content archive |
ITA_TAG_MAP_YAML_PATH | The full path to a YAML file containing a tag mapping (optional) |
The status archive is a directory of JSON files. Each file represents one status.
The update-archive
command downloads the most recent statuses and adds any new
ones to the archive. The --force
option will overwrite any existing status files.
A directory of the media files (images) that are part of the statuses in the status archive. Populating the media archive occurs during the update of the status archive.
The content archive is a directory of Markdown files. Each file represents one status.
The update-content
command will create one Markdown file for each archived status
not in the content archive. The --force
option will overwrite any existing
Markdown files.
Using the update-content
command creates one Markdown file for every status.
In contrast, the update-photos
command creates a directory for each status that
contains an index.md file and the attached media.
The following items are on my road map:
- Add any other functionality as required
I developed this app for a couple of reasons, including:
- Easily archive my toots in a place that I controlled
- Convert the toots into content for a Hugo powered website
- Scratch the itch that comes with being a software developer
- Keep using my software development skills
- Continue to learn
There is no guarantee that the app will work for anyone other than me. I'm putting up here on GitHub as a way of showing what is possible.
If you'd like to get in contact, you can do so via my website.