mirror of
https://github.com/pablouser1/ProxiTok.git
synced 2024-12-06 19:27:30 +01:00
34 lines
893 B
PHP
34 lines
893 B
PHP
<?php
|
|
namespace App\Controllers;
|
|
|
|
use App\Helpers\ErrorHandler;
|
|
use App\Helpers\Misc;
|
|
use App\Helpers\Wrappers;
|
|
use App\Models\FeedTemplate;
|
|
use App\Models\RSSTemplate;
|
|
|
|
class ForYouController {
|
|
public static function get() {
|
|
$api = Wrappers::api();
|
|
$fyp = $api->foryou();
|
|
$fyp->feed();
|
|
if ($fyp->ok()) {
|
|
$feed = $fyp->getFeed();
|
|
Wrappers::latte('foryou', new FeedTemplate('For you', $feed));
|
|
} else {
|
|
ErrorHandler::showMeta($fyp->error());
|
|
}
|
|
}
|
|
|
|
public static function rss() {
|
|
$api = Wrappers::api();
|
|
$fyp = $api->foryou();
|
|
$fyp->feed();
|
|
if ($fyp->ok()) {
|
|
$feed = $fyp->getFeed();
|
|
Misc::rss('For you');
|
|
Wrappers::latte('rss', new RSSTemplate('For you', 'For you Page', '', Misc::url('/foryou'), $feed->items));
|
|
}
|
|
}
|
|
}
|