Fixed trending, added explanation on VERIFY_CODE

This commit is contained in:
Pablo Ferreiro 2022-03-11 22:46:12 +01:00
parent 1e1376506c
commit f1de8e979b
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
6 changed files with 65 additions and 9 deletions

View file

@ -9,9 +9,15 @@ use App\Helpers\RSS;
class TrendingController {
static public function get() {
$cursor = Misc::getTtwid();
$page = $_GET['page'] ?? 0;
$api = Misc::api();
$feed = $api->getTrending($cursor, $page);
// Ttwid if normal, cursor if legacy
if ($api::class === 'TikScraper\Api') {
$cursor = Misc::getTtwid();
} else {
$cursor = Misc::getCursor();
}
$feed = $api->getTrending($cursor);
if ($feed->meta->success) {
$latte = Misc::latte();
$latte->render(Misc::getView('trending'), new FeedTemplate('Trending', $feed));