Skip to content

Instantly share code, notes, and snippets.

View RayHollister's full-sized avatar

Ray Hollister RayHollister

View GitHub Profile
@RayHollister
RayHollister / Automated Composer to Grove Radio Show Schedule
Last active August 14, 2023 20:16
This JavaScript fetches and formats the weekly broadcast schedule of a specific NPR radio show from their API. It groups same times on sequential days and displays the schedule on the radio show's webpage. The script runs automatically on page load, if no schedule is already present.
<script>
const daysOfWeek = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
async function getShowSchedule() {
let scheduleDiv = document.querySelector(".RadioShowPage-mediaSchedule");
if (scheduleDiv) return;
const programName = document.querySelector(".RadioShowPage-headline").textContent.trim();
try {