2.5 KiB
2.5 KiB
MastodonAPI
A plugin to import your public Toots via the Mastodon API into your Yellow Blog. The plugin works with Mastodon and with GoToSocial.
Installation
- Download the ZIP file
- Copy it into the
/system/extensionsdirectory - Reload your website – the plugin is now installed
Usage
The plugin is triggered via a custom webhook.
When the webhook is called, it fetches your Toots from the Mastodon API and creates blog posts from them.
Optionally, you can specify a #hashtag to import only matching posts.
Settings
All settings are in system/extensions/yellow-system.ini:
- MastodonapiInstanceUrl – your Mastodon instance URL (e.g.
https://mastodon.social) - MastodonapiAccountId - your Mastodon user ID (numeric, e.g. 1234567890)
- Find the ID of a Mastodon account: Enter "https://YOUR_INSTANCE_URL/api/v1/accounts/lookup?acct=PROFILNAME" in your browser.
- Find the ID of a GoToSocial account (see here)
- MastodonapiAccessToken
- Optional for a Mastodon account
- Mandatory for a GoToSocial account (see here)
- MastodonapiLimit - Default value is 20
- MastodonapiHashtag – leave empty to import all public posts; set to
#hashtagto import only matching posts - MastodonapiAuthor – author name to use for imported blog posts
- MastodonapiTag – tag to assign to imported blog posts
- MastodonapiFolder – path to your blog folder (e.g.
content/1-blog/) - MastodonapiTriggerPath – webhook path, e.g.
/mastodonapi-webhook-CHANGE_THIS_SECRET_KEY
(Be sure to change it! Anyone with this link can trigger the plugin.) - MastodonapiStatus – Default value is public
- public = page is a normal page
- draft = page is not visible, user needs to log in, requires draft extension
- unlisted = page is not visible, but can be accessed with the correct link
- MastodonapiMaxAge – Default value is 0
- In Stunden. 0 = all Toots.
💡 You can also call the webhook via a cron job to run the plugin automatically (e.g., every hour).
Developer
Simon Pipe