$tags = Tag::getGlobalTrendingHashtags(24, 20);
foreach ($tags as $tag) {
$tag['name'] = $tag['term'];
- $hashtag = new \Friendica\Object\Api\Mastodon\Tag(DI::baseUrl(), $tag);
+ $history = [['day' => (string)time(), 'uses' => (string)$tag['score'], 'accounts' => (string)$tag['authors']]];
+ $hashtag = new \Friendica\Object\Api\Mastodon\Tag(DI::baseUrl(), $tag, $history);
$trending[] = $hashtag->toArray();
}
protected $name;
/** @var string */
protected $url = null;
+ /** @var array */
+ protected $history = [];
/**
* Creates a hashtag record from an tag-view record.
* @param array $tag tag-view record
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public function __construct(BaseURL $baseUrl, array $tag)
+ public function __construct(BaseURL $baseUrl, array $tag, array $history = [])
{
- $this->name = strtolower($tag['name']);
- $this->url = $baseUrl . '/search?tag=' . urlencode($this->name);
+ $this->name = strtolower($tag['name']);
+ $this->url = $baseUrl . '/search?tag=' . urlencode($this->name);
+ $this->history = $history;
}
}