Public
Edited
Jun 5, 2024
3 forks
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
getPodcasts = async (url) => {
try {
const response = await fetch(`https://corsproxy.io/?` + url);
const html = await response.text();
const parser = new DOMParser();
const doc = parser.parseFromString(html, "text/html");
const links = Array.from(doc.querySelectorAll("a"));
const podcasts = links
.map((link) => link.getAttribute("href"))
.filter((href) => /[a-zA-Z]+\/podcasts\/.+\//.test(href));
return podcasts;
} catch (error) {
console.error("Erreur lors de la récupération des podcasts :", error);
return [];
}
}
Insert cell
lastpodcasts = getPodcasts(url)
Insert cell
lastpodcastsurl = lastpodcasts.map((d) => `https://www.radiofrance.fr${d}`)
Insert cell
results = await Promise.all(
lastpodcastsurl.map(async (d) => await getPeople(d))
).then((d) => d.flat())
Insert cell
import { getPeople } from "@pac02/how-to-get-the-list-of-participants-to-a-radio-program"
Insert cell
moment = require("moment")
Insert cell
moment.locale("fr", {
months:
"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split(
"_"
),
monthsShort:
"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),
weekdays: "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),
weekdaysShort: "dim._lun._mar._mer._jeu._ven._sam.".split("_"),
weekdaysMin: "di_lu_ma_me_je_ve_sa".split("_")
})
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more