Audio Archive: API start and end?

For KGLT’s recently redesigned site, we built an Archive player with a selectable list of the last 2 weeks of shows: https://kglt.net/listen/archive/

@tom , as I recall, you mentioned in this forum that the archive streams get processed by about 10min past each hour. Is that correct? Our API-call asks for playlists with a 'start' of 2-weeks ago and an 'end' of 90-minutes ago. Are those good values for getting all playlists with audio but not getting an hour yet-to-have a stream? Thx.

1 Like

Yes, that should work.

That’s a neat web integration job. I like it.

Correct me if I’m wrong: you have Spinitron playlist in an iframe, the ark-player direct from npm/github, and, I suppose, you’re creating those lovely show-btn buttons with scripts of your own using the GET /playlists API endpoint.

Right, @tom,:

  • Date and show data grabbed via API using your getClient.php.
  • DJ/Show name ('personas') grabbed from another API call (via 'persona_id').
  • Date-pulldown and its show-buttons populated with API data (and our CSS styles).
  • Playlist is in an iframe.
  • Ark-player is lifted from your HTML/JS at GitHub, with our CSS added.
  • Ark-player and playlist-iframe are hidden until user selects a show.
  • Once selection made, iframe src is the selected playlist URL.

Whole shebang inspired by the way KEXP does it: https://kexp.org/archive/

2 Likes

Nicely done, for which my second hat tip this morning :tophat:

I should say that my SpinitronApiClient is not designed to be robust, it’s designed to be tutorial with the minimum lines of code to get you started and demonstrate fetching, searching and caching. If it works for you, great, but if it breaks, I don’t want to have to fix it :P

Also, pay attention to garbage collection as discussed on this page.

Tip o’ hat much appreciated. And now that you mention it: I do see your clearly stated Caveats re: robustness and garbage collection. (I really gotta learn to RTFM.) Will take your tut and adapt it to our needs when time permits. Thanks for pointing this out.

1 Like