https://github.com/baguettephp/mastodon-api
Mastodon API Client/SDK for PHP
https://github.com/baguettephp/mastodon-api
mastodon-api php
Last synced: about 1 year ago
JSON representation
Mastodon API Client/SDK for PHP
- Host: GitHub
- URL: https://github.com/baguettephp/mastodon-api
- Owner: BaguettePHP
- License: gpl-3.0
- Created: 2017-04-26T10:55:52.000Z (about 9 years ago)
- Default Branch: development
- Last Pushed: 2017-06-27T12:08:46.000Z (almost 9 years ago)
- Last Synced: 2024-04-13T12:53:27.280Z (about 2 years ago)
- Topics: mastodon-api, php
- Language: PHP
- Homepage: https://baguettephp.github.io/mastodon-api/
- Size: 1.09 MB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Baguette PHP Mastodon API Client / SDK
[](https://packagist.org/packages/zonuexe/mastodon-api)
[](https://packagist.org/packages/zonuexe/mastodon-api)
[](https://travis-ci.org/BaguettePHP/mastodon-api)
[](https://scrutinizer-ci.com/g/BaguettePHP/mastodon-api/?branch=master)
[](https://scrutinizer-ci.com/g/BaguettePHP/mastodon-api/?branch=master)
[](https://codeclimate.com/github/BaguettePHP/mastodon-api)
## Installation
```
$ composer require zonuexe/mastodon-api
```
## Requires
* PHP 5.5, 5.6, 7.0, 7.1, HHVM
* [Composer](https://getcomposer.org/)
## Features
* IDE (PhpStorm) friendly class/function definitions
* Support [multiparadigm programming](https://en.wikipedia.org/wiki/Programming_paradigm) style (procedural vs OOP)
## Usage
### Simple procedural style
```php
'read write follow',
'grant' => ['username' => $username, 'password' => $password],
]
);
// Get account by ID
$account = $service->getAccount(42);
// Toot!
$status = $service->postStatus(m\toot('トゥートゥー'));
```
### Manually API request
If you want to request unimplemented APIs in this SDK, you can write the request manually. This technique is also useful when requesting instance-specific APIs.
```php
█
```
## Status of implementations
* [x] GET /api/v1/accounts/:id `Account Mastodon::getAccount(int $id)`
* [x] GET /api/v1/accounts/verify_credentials `Account Mastodon::getAccountCurrentUser()`
* [x] PATCH /api/v1/accounts/update_credentials `Account Mastodon::updateAccount(array $update_data)`
* [x] GET /api/v1/accounts/:id/followers `Account[] getAccountFollowers(int $account_id)`
* [ ] GET /api/v1/accounts/:id/following
* [ ] GET /api/v1/accounts/:id/statuses
* [ ] POST /api/v1/accounts/:id/follow
* [ ] POST /api/v1/accounts/:id/unfollow
* [ ] GET /api/v1/accounts/:id/block
* [ ] GET /api/v1/accounts/:id/unblock
* [ ] GET /api/v1/accounts/:id/mute
* [ ] GET /api/v1/accounts/:id/unmute
* [ ] GET /api/v1/accounts/relationships
* [ ] GET /api/v1/accounts/search
* [ ] POST /api/v1/apps
* [x] GET /api/v1/blocks `Account[] getBlocks(array $options = [])`
* [x] GET /api/v1/favourites `Status[] getFavourites(array $options = [])`
* [x] GET /api/v1/follow_requests `Account[] getFollowRequests(array $options = [])`
* [ ] POST /api/v1/follow_requests/:id/authorize
* [ ] POST /api/v1/follow_requests/:id/reject
* [ ] POST /api/v1/follows
* [ ] GET /api/v1/instance
* [ ] POST /api/v1/media
* [ ] GET /api/v1/mutes
* [ ] GET /api/v1/notifications
* [ ] GET /api/v1/notifications/:id
* [ ] POST /api/v1/notifications/clear
* [ ] GET /api/v1/reports
* [ ] POST /api/v1/reports
* [ ] GET /api/v1/search
* [x] GET /api/v1/statuses/:id `Status getStatus($status_id)`
* [ ] GET /api/v1/statuses/:id/context
* [ ] GET /api/v1/statuses/:id/card
* [ ] GET /api/v1/statuses/:id/reblogged_by
* [ ] GET /api/v1/statuses/:id/favourited_by
* [x] POST /api/v1/statuses `Status Mastodon::postStatus(Toot $toot)`
* [ ] DELETE /api/v1/statuses/:id
* [ ] POST /api/v1/statuses/:id/reblog
* [ ] POST /api/v1/statuses/:id/unreblog
* [ ] POST /api/v1/statuses/:id/favourite
* [ ] POST /api/v1/statuses/:id/unfavourite
* [ ] GET /api/v1/timelines/home
* [ ] GET /api/v1/timelines/public
* [ ] GET /api/v1/timelines/tag/:hashtag
Copyright
---------
**Baguette\\Mastodon** is licensed under [GNU General Public License, Version 3.0](https://www.gnu.org/licenses/gpl-3.0.html). See `./LICENSE`.
Baguette Mastodon - Mastodon API Client for PHP
Copyright (c) 2016 Baguette HQ / USAMI Kenta