mastodon-admintools/functions.php

15 lines
443 B
PHP

<?php
require_once("vendor/autoload.php");
function get_api_client() {
global $conf;
$oAuth = new Colorfield\Mastodon\MastodonOAuth($conf["app"], $conf["instance"]);
$oAuth->config->setClientId($conf["client_id"]);
$oAuth->config->setClientSecret($conf["client_secret"]);
$oAuth->config->setBearer($conf["bearer"]);
$mastodonAPI = new Colorfield\Mastodon\MastodonAPI($oAuth->config);
return $mastodonAPI;
}