dolibarr 21.0.0-alpha
FediverseParser Class Reference

Class to parse Fediverse files. More...

Public Member Functions

 __construct ($platform)
 Constructor.
 
 parser ($urlAPI, $maxNb=5, $cacheDelay=60, $cacheDir='')
 Parse Fediverse API to retrieve posts.
 
 getPosts ()
 Get the list of retrieved posts.
 
 getLastFetchDate ()
 Get the last fetch date.
 

Detailed Description

Class to parse Fediverse files.

Definition at line 30 of file fediverseparser.class.php.

Constructor & Destructor Documentation

◆ __construct()

FediverseParser::__construct ( $platform)

Constructor.

Parameters
string$platformname of social network

Definition at line 52 of file fediverseparser.class.php.

Member Function Documentation

◆ getLastFetchDate()

FediverseParser::getLastFetchDate ( )

Get the last fetch date.

Returns
int|String Timestamp of the last successful fetch.

Definition at line 99 of file fediverseparser.class.php.

◆ getPosts()

FediverseParser::getPosts ( )

Get the list of retrieved posts.

Returns
array List of posts.

Definition at line 89 of file fediverseparser.class.php.

◆ parser()

FediverseParser::parser ( $urlAPI,
$maxNb = 5,
$cacheDelay = 60,
$cacheDir = '' )

Parse Fediverse API to retrieve posts.

Parameters
string$urlAPIURL of the Fediverse API.
int$maxNbMaximum number of posts to retrieve (default is 5).
int$cacheDelayNumber of seconds to use cached data (0 to disable caching).
string$cacheDirDirectory to store cached data.
Returns
int Status code: <0 if error, >0 if success.

Definition at line 69 of file fediverseparser.class.php.


The documentation for this class was generated from the following file: