RSS initial support

This commit is contained in:
Pablo Ferreiro 2022-01-28 15:54:09 +01:00
parent ecdc8241e7
commit bd1642957c
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
21 changed files with 329 additions and 161 deletions

View file

@ -1,10 +1,10 @@
<?php
use Steampixel\Route;
const VALID_TIKTOK_DOMAINS = [
"tiktokcdn.com", "tiktokcdn-us.com", "tiktok.com"
];
/**@var Bramus\Router\Router $router */
/**
* Check if an url has a valid domain
* @param string $url URL you want to check
@ -16,7 +16,7 @@ function isValidDomain(string $url): bool {
return count($host_split) === 3 && in_array($host_split[1] . '.' . $host_split[2], VALID_TIKTOK_DOMAINS);
}
Route::add('/stream', function () {
$router->get('/stream', function () {
if (!isset($_GET['url'])) {
die('You need to send a url!');
}