-
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathschedule.php
More file actions
19 lines (15 loc) · 612 Bytes
/
schedule.php
File metadata and controls
19 lines (15 loc) · 612 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
require 'tohost.php';
// Get the date parameter from the URL (default to today)
$date = isset($_GET['date']) ? $_GET['date'] : date('Y-m-d');
define('BASE_API_URL', 'https://aniwatch-api-i02m.onrender.com');
$scheduleEndpoint = "/api/v2/hianime/schedule?date=$date";
$scheduleApiUrl = BASE_API_URL . $scheduleEndpoint;
$scheduleResponse = file_get_contents($scheduleApiUrl);
$scheduleData = json_decode($scheduleResponse, true);
if ($scheduleData && $scheduleData['success']) {
echo json_encode($scheduleData['data']['scheduledAnimes']);
} else {
echo json_encode([]);
}
?>