mirror of
https://github.com/friendica/friendica
synced 2025-04-22 05:50:13 +00:00
Add support to Mastodon Tag Trends for paging, local tags, and faster refresh
= with phpcbf format auto-correction
This commit is contained in:
parent
90717b602e
commit
c5effdadec
2 changed files with 51 additions and 28 deletions
|
@ -37,11 +37,18 @@ class Tags extends BaseApi
|
|||
protected function rawContent(array $request = [])
|
||||
{
|
||||
$request = $this->getRequest([
|
||||
'limit' => 20, // Maximum number of results to return. Defaults to 10.
|
||||
'limit' => 20, // Maximum number of results to return. Defaults to 20.
|
||||
'offset' => 0,
|
||||
'friendica_local' => false,
|
||||
], $request);
|
||||
|
||||
$trending = [];
|
||||
$tags = Tag::getGlobalTrendingHashtags(24, 20);
|
||||
if ($request['friendica_local']) {
|
||||
$tags = Tag::getLocalTrendingHashtags(24, $request['limit'], $request['offset']);
|
||||
} else {
|
||||
$tags = Tag::getGlobalTrendingHashtags(24, $request['limit'], $request['offset']);
|
||||
}
|
||||
|
||||
foreach ($tags as $tag) {
|
||||
$tag['name'] = $tag['term'];
|
||||
$history = [['day' => (string)time(), 'uses' => (string)$tag['score'], 'accounts' => (string)$tag['authors']]];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue