diff options
| author | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-26 18:23:46 -0700 |
|---|---|---|
| committer | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-26 18:23:46 -0700 |
| commit | c8a588062f31b00b8c302a3e9f5fff6b43110dc2 (patch) | |
| tree | 95c83ae6762334d32bcea5217bbd827fb645cb52 /aero.js | |
| parent | ee3b563ecec4a6e9e7755d3ed6bc08faa3916545 (diff) | |
podcast: switch to server-side php proxy for rss feed
itunes api unreachable from browser on vps. podcast.php fetches
anchor.fm rss server-to-server, parses xml, returns json.
1h cache header to avoid hammering the feed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'aero.js')
| -rw-r--r-- | aero.js | 23 |
1 files changed, 3 insertions, 20 deletions
@@ -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 }; |
