SocialNetworkManager
class SocialNetworkManager (View source)
Class to manage Social network posts
Properties
| DoliDB | $db | ||
| string | $error |
Methods
__construct($platform, array{username?: string, password?: string, name_app?: string, client_id?: string, client_secret?: string, redirect_uri?: string, access_token?: string} $authParams = [])
Constructor
bool
fetchPosts(string $urlAPI, int $maxNb = 5, int $cacheDelay = 60, string $cacheDir = '', array{username?: string, password?: string, name_app?: string, client_id?: string, client_secret?: string, redirect_uri?: string, access_token?: string} $authParams = [])
Fetch Social Network API to retrieve 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.
int
getLastFetchDate()
Get the last fetch date.
Details
__construct($platform, array{username?: string, password?: string, name_app?: string, client_id?: string, client_secret?: string, redirect_uri?: string, access_token?: string} $authParams = [])
Constructor
@param string $platform name of social network
bool
fetchPosts(string $urlAPI, int $maxNb = 5, int $cacheDelay = 60, string $cacheDir = '', array{username?: string, password?: string, name_app?: string, client_id?: string, client_secret?: string, redirect_uri?: string, access_token?: string} $authParams = [])
Fetch Social Network API to retrieve 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.
int
getLastFetchDate()
Get the last fetch date.