topi-k/misskeyauth

PHP Library for Misskey Instance

0.1 2023-03-15 13:28 UTC

This package is auto-updated.

Last update: 2025-07-15 18:28:36 UTC


README

PRs Welcome MIT License

This script is PHP Library for Misskey Instance.

Requirement

upper than PHP 8.0

Usage

Authenticate the user

Generate authentication URL

use Topi\MisskeyAuth\MiAuth;

$mi = new MiAuth;
$mi->setInstance("misskey.example.com");
echo $mi->GenerateAuthURI("TestApp", "https://localhost/callback", ["write:notes"]);

Get user token

use Topi\MisskeyAuth\MiAuth;

$mi = new MiAuth;
$mi->setUUID("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa");
echo $mi->getAccessToken();

Post a note

use Topi\MisskeyAuth\MiAuth;

$auth = new MiAuth();
$auth->SetUserToken("TOKEN");
$auth->post("notes/create",["text" => "APIからテスト!", "visibility" => "followers"]);

Get user information

use Topi\MisskeyAuth\MiAuth;

$auth = new MiAuth;
$auth->SetUserToken("TOKEN");

echo $auth->get("i",[]);

Install

Use composer (Recommended)

composer install topi-k/misskeyauth

Other

It is not complete. Sorry.Pull requests are welcome.

Licence

MIT

Author

topi-k