aboutsummaryrefslogtreecommitdiff
path: root/aero.js
diff options
context:
space:
mode:
Diffstat (limited to 'aero.js')
-rw-r--r--aero.js23
1 files changed, 3 insertions, 20 deletions
diff --git a/aero.js b/aero.js
index 01a9b83..98cb8ec 100644
--- a/aero.js
+++ b/aero.js
@@ -177,26 +177,9 @@ async function fetchVisitorCount() {
}
async function fetchReelMouthFeed(limit = 6) {
- const url = `https://itunes.apple.com/lookup?id=1709836497&entity=podcastEpisode&limit=${limit + 1}`;
- const r = await fetch(url);
- if (!r.ok) throw new Error('itunes ' + r.status);
- const j = await r.json();
- const podcast = j.results.find(x => x.kind === 'podcast');
- const episodes = j.results.filter(x => x.kind === 'podcast-episode').slice(0, limit);
- return {
- art: podcast ? podcast.artworkUrl600 : null,
- episodes: episodes.map(e => {
- const ms = e.trackTimeMillis || 0;
- const mins = Math.floor(ms / 60000);
- const h = Math.floor(mins / 60);
- const m = mins % 60;
- return {
- title: e.trackName,
- url: e.trackViewUrl,
- duration: h ? `${h}:${m.toString().padStart(2, '0')}` : `${m}m`,
- };
- }),
- };
+ const r = await fetch(`/podcast.php?limit=${limit}`);
+ if (!r.ok) throw new Error('podcast.php ' + r.status);
+ return await r.json();
}
window.Aero = { spawnBubbles, makeClouds, sparkleCursor, makeDraggable, counterHTML, nowPlayingHTML, animateEq, musicToggleHTML, bindMusicToggle, fetchLastFm, fetchFilms, fetchVisitorCount, fetchReelMouthFeed };