Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cdaecke/md_mastodon

TYPO3 extension to show toots of the Mastodon social network via the API.
https://github.com/cdaecke/md_mastodon

Last synced: 3 months ago
JSON representation

TYPO3 extension to show toots of the Mastodon social network via the API.

Awesome Lists containing this project

README

        

# TYPO3 Extension `md_mastodon`

With this extension you are able to show Mastodon toots on your TYPO3 website.
It will collect data via the API and display it as a Mastodon social wall.

## Screenshots

Example of Mastodon social wall:
![Screenshot detail](Documentation/Images/mastodon_wall.png?raw=true "Mastodon social wall")

## Requirements

- TYPO3 v11.5 | v12.4

## Installation

- Install the extension by using composer (`composer req mediadreams/md_mastodon`) or the extension manager
- Include the static TypoScript of the extension
- Configure the extension by setting your own Typoscript constants

- `plugin.tx_mdmastodon_api.settings.includeCss`

Include standard CSS styles for a masonry-layout if the items (toots).

### Template layouts

You are able to configure template layouts in `TsConfig`:

```
tx_mdmastodon_api {
templateLayouts {
1 = First layout
2 = Second layout
}
}
```

## Usage

### Create a new entry of type `Mastodon configuration`
1. Select module `List`
2. Select a page where to store the record (can be any page)
3. Click the button `Create new record`
4. In the section `Mastodon social networking API` click `Mastodon configuration`

Now you are able to configure a Mastodon feed, which you want to show on the website.

Step 1-3:
![Screenshot detail](Documentation/Images/new_configuration_1.png?raw=true "Step 1-3")

Step 4:
![Screenshot detail](Documentation/Images/new_configuration_2.png?raw=true "Step 4")

**Configure the feed**
- `Title`

This is for internal use only. It is needed, in order to select the feed in the plugin.
- `Base Api URL`

The Mastodon base api URL, like `https://mastodon.social/api/v1/`. You can leave
this empty, if you have configured a default URL in typoscript constant
`plugin.tx_mdmastodon_api.settings.apiUrl`.
- `Api token`

Mastodon API token. You can leave this empty, if you have configured a default
API token in typoscript constant `plugin.tx_mdmastodon_api.settings.apiToken`.

ATTENTION: Make sure, that you have given the appropriate rights to your Mastodon application, when generating the API key.
- `Api method`

Select the Mastodon API method.
- `Accounts`

Statuses posted to the given account. See
- `Account ID` (required)

The ID of the Account in the Mastodon database.
- `Exclude replies`

Filter out statuses in reply to a different account.
- `Exclude reblogs`

Filter out boosts from the response.
- `Pinned`

Filter for pinned statuses only.
- `Hashtag timeline`

View public statuses containing the given hashtag. See
- `Hashtag`

The name of the hashtag (not including the # symbol).
- `Home timeline`

View statuses from followed users. See
- `List timeline`

View statuses in the given list timeline. See
- `List ID`

Local Mastodon ID of the list in the database.
- `Public timeline`

Public timeline of instance. See
- `Only media`

Show only statuses with media attached.
- `Update frequency`

Decide how often the feed should be updated (number in seconds).
- `Import date` (read only)

Date of last update.
- `Data` (read only)

JSON response of the API call.

### Create scheduler task
- Select module `Scheduler`
- Click the button `Add task`
- In field `Class` select `Execute console commands`
- Choose a `Frequency`. Note: This can be set for example to 5 minutes and the respective Mastodon feed will be updated, as set in the configuration of the feed (field `Update frequency`).
- In field `Schedulable Command. Save and reopen to define command arguments` choose `mdmastodon:import`
- Save

### Create Plugin to show entries
- Select module `Page`
- Select the page where to show the Mastodon feed
- Create new content element of type `General Plugin`
- Switch to tab `Plugin` and select `Mastodon`
- In field `Mastodon configuration` find the configuration, which you have created in the step before
- Decide, how many entries to show be setting a value in field `Limit`
- Save

**ATTENTION**

Be aware, that the feed needs to be imported by running the scheduler task
before it can be displayed by the plugin!

## Bugs and Known Issues
If you find a bug, it would be nice if you add an issue on [Github](https://github.com/cdaecke/md_mastodon/issues).

# THANKS

Thanks a lot to all who make this outstanding TYPO3 project possible!

**The TYPO3 project - inspiring people to share!**