I was bored while watching anime on Bilibili, opened the console, and discovered an API that can fetch the recently updated shows. Since clicking into Bilibili’s anime schedule is too much trouble [DarkBText]too lazy[/DarkBText], I made a page that directly grabs the latest updates for future viewing.
First, visit this API; it returns a huge blob of data.

Returned stuff
Paste the returned data into a JSON parser and you can clearly see its structure. With that info, we can start writing PHP.
{
"code": 0,
"message": "success",
"result": [{
"date": "8-14",//update date
"date_ts": 1597334400,
"day_of_week": 5,//weekday of update, here Friday
"is_today": 0,//is today; 0-no, 1-yes
"seasons": [{
"cover": "http://i0.hdslb.com/bfs/bangumi/image/7bbe825a8d65056b0918
724f3f376e2d3f3c0b15.png",//anime image
"delay": 0,
"ep_id": 334752,
"favorites": 217346,
"follow": 0,
"is_published": 1,
"pub_index": "第5话",//which episode
"pub_time": "01:05",
"pub_ts": 1597338300,
"season_id": 33083,
"season_status": 2,
"square_cover": "http://i0.hdslb.com/bfs/bangumi/image/aed4f3d2885434b9610
da34a311203cd30fb2a2d.jpg",
"title": "富豪刑警 Balance:UNLIMITED(僅限港澳台地區)",//anime title
"url": "https://www.bilibili.com/bangumi/play/ss33083"//anime URL
},
.....
Use file_get_contents() to read the API data into $get, then json_decode() to decode the JSON string and store it in $data.
$get = file_get_contents("https://bangumi.bilibili.com/web_api/timeline_global");
$data = json_decode($get, true);
The API provides schedules for the next 13 days. From the response, date is an item under result, so result contains 13 entries. We can treat the result[] array length as 13 and loop through each day.
Use date('n') to get the current month and date('j') for the day, storing them in $nowtime; use $data[result][$d][date] to get the anime update date into $pub_time, then compare the dates.
Why not date('m') and date('d')? Because $pub_time outputs single-digit months without leading zeros, and date('n') does the same, keeping formats consistent. As for date('j'), since it’s unclear whether single-digit days in $pub_time have leading zeros, we assume they don’t.
Next, handle entries whose update time is greater than or equal to now—the list we want to display. From the API, seasons[] holds the data we need. Use count($data[result][$d][seasons]) to get how many seasons each result[] has; loop through each seasons[] and extract key fields to build the complete script:
Add some CSS styling and you get a nice-looking anime schedule.