Public
Edited
Jun 7, 2024
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
getRSS = 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/xml");
const links = Array.from(doc.getElementsByTagName("link"));
const podcasts = links
.map((link) => link.textContent)
.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
getTitle = 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/xml");
const title = doc.getElementsByTagName("title")[0];

return title.textContent;
} catch (error) {
console.error("Erreur lors de la récupération des podcasts :", error);
return [];
}
}
Insert cell
getTitle(url)
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