Interacting with Mastodon's REST API for Kirby v3

Overview

Kirby3 Mastodon

Release License Issues

This plugin provides access to your Mastodon statuses, called 'toots'.

Getting started

Use one of the following methods to install & use kirby3-mastodon:

Git submodule

If you know your way around Git, you can download this plugin as a submodule:

git submodule add https://github.com/Fundevogel/kirby3-mastodon.git site/plugins/kirby3-mastodon

Composer

composer require fundevogel/kirby3-mastodon

Clone or download

  1. Clone or download this repository.
  2. Unzip / Move the folder to site/plugins.

Configuration

You may change certain options from your config.php globally ('kirby3-mastodon.optionName'):

Option Type Default Description
'instance' string mastodon.social Mastodon instance
'client_key' string '' Client key
'client_secret' string '' Client secret
'access_token' string '' Access token
'app_name' string 'Test App' Application name
'app_url' string '' Application URL
'cache_duration' int 'auto' Cache duration for toots (in minutes)
'download_media' bool 'weit' Whether images should be downloaded
'template' string mastodon.image File template for downloaded images

Note: For starters, register an application (Edit profile > Development > New Application) & enter its fundevogel.mastodon.access_token - otherwise, you'll only be granted application-level access.

Usage

There's a snippet to get you started:

# Timeline of currently active account
 snippet('mastodon') ?>

# Timeline of a different account
 snippet('mastodon', ['account' => '1234567890']) ?>

# Specific status (any account)
 snippet('mastodon', ['id' => '1234567890']) ?>

It's pretty much a boilerplate to get you started - enjoy!

Methods

There are several ways to do this, you can either work with a php-mastodon API object (via site method) or two page methods:

Site method: $site->mastodon(): \Fundevogel\Mastodon\Api

Grants access to a fully-enabled Api instance (see here).

Page method: $page->toot(string $id): array

Get matching 'toot' for given $id.

Page method: $page->toots(string $id = '')

Get last 20 'toots' of given account $id (defaults to currently active account).

Roadmap

  • Add tests

Credits / License

Mastodon is owned and operated by Eugen Rochko aka Gargron and his Mastodon gGmbH (german non-profit limited liability company). Thanks, Eugen!

kirby3-mastodon is based on php-mastodon library, both licensed under the GPL v3 License, but using Kirby in production requires you to buy a license.

Special Thanks

I'd like to thank everybody that's making great software - you people are awesome. Also I'm always thankful for feedback and bug reports :)

You might also like...
API SDK for OpenTrade Commerce API: Taobao, Alibaba, JD, 1688, Aliexpress, Ebay.

OtapiPhpClient Create Client $client = new OtClient($key, $secret, $lang); key (Access Key) secret (Secret for access key) language (2 symbol lang id

Fanmade project using Twitter API and Marvel API.
Fanmade project using Twitter API and Marvel API.

Project Marvel Memories A fanmade project in PHP using API Twitter V2, Marvel API and Github action scheduler. What about? Posts a random cover with d

API client for ThePay - payment gate API
API client for ThePay - payment gate API

This is the official highly compatible public package of The Pay SDK which interacts with The Pay's REST API. To get started see examples below.

Code Quiz MonoRepo (API, API Client, App)

Code Quiz Welcome to the Code Quiz Open Source project from How To Code Well. This is an Open Source project that includes an API and an App for the d

OpenAI API Client is a component-oriented, extensible client library for the OpenAI API. It's designed to be faster and more memory efficient than traditional PHP libraries.

OpenAI API Client in PHP (community-maintained) This library is a component-oriented, extensible client library for the OpenAI API. It's designed to b

PHP library for the Stripe API.

Stripe PHP bindings The Stripe PHP library provides convenient access to the Stripe API from applications written in the PHP language. It includes a p

A simple PHP GitHub API client, Object Oriented, tested and documented.

PHP GitHub API A simple Object Oriented wrapper for GitHub API, written with PHP. Uses GitHub API v3 & supports GitHub API v4. The object API (v3) is

A PHP library for the Campaign Monitor API

createsend A PHP library which implements the complete functionality of the Campaign Monitor API. Installation Composer If you use Composer, you can r

PHP 5.3+ library which helps you to interact with the DigitalOcean API

DigitalOcean The version 2 of the API will be available soon ! Please visit DigitalOceanV2 and contribute :) This PHP 5.3+ library helps you to intera

Releases(1.0.0)
Owner
Fundevogel
Kinder- und Jugendbuchhandlung
Fundevogel
Nexmo REST API client for PHP. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.

Client Library for PHP Support Notice This library and it's associated packages, nexmo/client and nexmo/client-core have transitioned into a "Maintena

Nexmo 75 Sep 23, 2022
A PHP library for communicating with the Twilio REST API and generating TwiML.

twilio-php The default branch name for this repository has been changed to main as of 07/27/2020. Documentation The documentation for the Twilio API c

Twilio 1.4k Jan 2, 2023
Twitter REST API for PHP 5.3+

README The Wid'op Twitter REST library is a modern PHP 5.3+ API allowing you to easily interact with Twitter 1.1. In order to sign your request with t

Wid'op 24 Aug 10, 2020
PHP library to use IOTA REST API to help node management and tangle queries

iota.php About PHP library to use IOTA REST API to help node management and tangle queries. Please be aware that this library is in an early developme

IOTA Community 45 Dec 13, 2022
Xendit REST API Client for PHP - Card, Virtual Account, Invoice, Disbursement, Recurring Payments, Payout, EWallet, Balance, Retail Outlets Services

Xendit REST API Client for PHP - Card, Virtual Account, Invoice, Disbursement, Recurring Payments, Payout, EWallet, Balance, Retail Outlets Services

Xendit 96 Jan 6, 2023
Пакет позволяющий работать с REST API SMS-сервиса «SMS Aero»

SMS-сервис «SMS Aero» ?? Пакет позволяющий работать с REST API SMS-сервиса «SMS Aero» ?? Изменения: Все заметные изменения в этом проекте будут задоку

Артём Соколовский 2 Feb 6, 2022
This library is for integration with Salesforce via REST API.

xsolve-pl/salesforce-client Introduction This library is for integration with Salesforce via REST API. Licence This library is under the MIT license.

Boldare / XSolve Sp. z o.o. 31 Oct 13, 2022
This package help you build your REST API documentation.

Laravel API Doc This package help you build your REST API documentation. Installation You can install the package via composer: composer require axeld

Axel 2 May 19, 2022
DigitalOcean API v2 client for Symfony and API Platform

DigitalOcean Bundle for Symfony and API Platform DunglasDigitalOceanBundle allows using the DigitalOcean API from your Symfony and API Platform projec

Kévin Dunglas 25 Jul 27, 2022
This package is a simple API laravel wrapper for Pokemontcg with a sleek Model design for API routes and authentication.

This package is a simple API laravel wrapper for Pokemontcg with a sleek Model design for API routes and authentication.

Daniel Henze 3 Aug 29, 2022