MastodonHandler
class MastodonHandler (View source)
Class for handler Mastodon
Properties
| string | $error |
Methods
__construct(array{client_id?: string, client_secret?: string, redirect_uri?: string, access_token?: string} $authParams)
Constructor to set the necessary credentials.
false|array{id: string, content: string, created_at: string, url: string, media_url: string}|array{}
fetch(string $urlAPI, int $maxNb = 5, int $cacheDelay = 60, string $cacheDir = '', array{client_id?: string, client_secret?: string, redirect_uri?: string, access_token?: string} $authParams = [])
Fetch posts from Mastodon API using the access token.
array{id: string, content: string, created_at: string, url: string, media_url: string}|array{}
normalizeData(array{content?: string, created_at?: string, url?: string, media_attachments?: array<array{url: string}>} $postData)
Normalize data of retrieved posts
array<array{id: string, content: string, created_at: string, url: string, author_name: string, author_avatar?: string}|array{}>
getPosts()
Get the list of retrieved posts.
string
getRedirectUri()
Getter for url to redirect
string
getAccessToken()
Getter for access token
string
getClientId()
Getter for client Id
string
getClientSecret()
Getter for secret client
Details
__construct(array{client_id?: string, client_secret?: string, redirect_uri?: string, access_token?: string} $authParams)
Constructor to set the necessary credentials.
false|array{id: string, content: string, created_at: string, url: string, media_url: string}|array{}
fetch(string $urlAPI, int $maxNb = 5, int $cacheDelay = 60, string $cacheDir = '', array{client_id?: string, client_secret?: string, redirect_uri?: string, access_token?: string} $authParams = [])
Fetch posts from Mastodon API using the access token.
array{id: string, content: string, created_at: string, url: string, media_url: string}|array{}
normalizeData(array{content?: string, created_at?: string, url?: string, media_attachments?: array<array{url: string}>} $postData)
Normalize data of retrieved posts
array<array{id: string, content: string, created_at: string, url: string, author_name: string, author_avatar?: string}|array{}>
getPosts()
Get the list of retrieved posts.
string
getRedirectUri()
Getter for url to redirect
string
getAccessToken()
Getter for access token
string
getClientId()
Getter for client Id
string
getClientSecret()
Getter for secret client