Meh includes built-in support for integrating with Mastodon, allowing you to import replies to your Mastodon posts as comments on your site.
To set up Mastodon integration:
- Configure your Mastodon account in your site settings:
./meh config mastodon_account "@yourusername@instance.social"
- If you're using GoToSocial, even read access requires an API token. The easiest way to get one is to use the Access Token Generator for Mastodon API. You only need the
read
scope.
./meh config mastodon_token "your-api-token"
- Set up a cron job to periodically fetch new posts and replies:
# Run every hour to check for new Mastodon posts and replies
0 * * * * /path/to/meh mastodon
For multi-site setups you need to set up a mastodon_account
config and cron job for each site. But you can have all sites use the same account.
The Mastodon integration:
- Fetches posts from your configured Mastodon account (uses the Mastodon API)
- Identifies posts that link to your site
- Tracks these posts in the database
- Periodically checks for replies to these posts
- Imports replies as comments on the corresponding blog post
This creates a seamless bridge between discussions on your blog and on the Fediverse.
You can manually trigger the Mastodon import process at any time:
./meh mastodon
This is useful for testing or for an initial import of existing conversations.