Fixed trending

This commit is contained in:
Pablo Ferreiro 2022-02-13 22:30:47 +01:00
parent 90cf0bfb56
commit 1d37d8c417
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
2 changed files with 5 additions and 1 deletions

View file

@ -8,7 +8,7 @@ use App\Helpers\RSS;
class TrendingController { class TrendingController {
static public function get() { static public function get() {
$cursor = Misc::getCursor(); $cursor = Misc::getTtwid();
$page = $_GET['page'] ?? 0; $page = $_GET['page'] ?? 0;
$api = Misc::api(); $api = Misc::api();
$feed = $api->getTrending($cursor, $page); $feed = $api->getTrending($cursor, $page);

View file

@ -9,6 +9,10 @@ class Misc {
return isset($_GET['cursor']) && is_numeric($_GET['cursor']) ? (int) $_GET['cursor'] : 0; return isset($_GET['cursor']) && is_numeric($_GET['cursor']) ? (int) $_GET['cursor'] : 0;
} }
static public function getTtwid(): string {
return $_GET['cursor'] ?? '';
}
static public function url(string $endpoint = '') { static public function url(string $endpoint = '') {
return self::env('APP_URL', '') . $endpoint; return self::env('APP_URL', '') . $endpoint;
} }