Implement time based paging for Mastodon Home Timeline Endpoint

This commit is contained in:
Hank Grabowski 2023-02-21 15:37:32 -05:00
parent b1b3b0ffe7
commit 818075d039
4 changed files with 131 additions and 22 deletions

View file

@ -154,6 +154,21 @@ class Status extends BaseDataTransferObject
$this->friendica = new FriendicaExtension($item['title'], $counts->dislikes);
}
/**
* Returns the current created_at DateTime as an integer timestamp
* @return int
* @throws \Exception
*/
public function createdAtTimestamp(): int
{
$result = strtotime($this->created_at);
if (!$result) {
throw new \Exception('Unknown date-time format');
}
return $result;
}
/**
* Returns the current entity as an array
*