mirror of
https://github.com/friendica/friendica
synced 2025-04-27 02:30:10 +00:00
API: Parameter cleanup
This commit is contained in:
parent
453e6a9d75
commit
e3d227f3c9
22 changed files with 147 additions and 80 deletions
|
@ -37,8 +37,9 @@ class Trends extends BaseApi
|
|||
*/
|
||||
public static function rawContent(array $parameters = [])
|
||||
{
|
||||
// Maximum number of results to return. Defaults to 10.
|
||||
$limit = (int)!isset($_REQUEST['limit']) ? 10 : $_REQUEST['limit'];
|
||||
$request = self::getRequest([
|
||||
'limit' => 20, // Maximum number of results to return. Defaults to 10.
|
||||
]);
|
||||
|
||||
$trending = [];
|
||||
$tags = Tag::getGlobalTrendingHashtags(24, 20);
|
||||
|
@ -48,6 +49,6 @@ class Trends extends BaseApi
|
|||
$trending[] = $hashtag->toArray();
|
||||
}
|
||||
|
||||
System::jsonExit(array_slice($trending, 0, $limit));
|
||||
System::jsonExit(array_slice($trending, 0, $request['limit']));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue