Public
Edited
Jun 7, 2024
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
async function getPeople(url) {
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 peopleLinks = Array.from(
doc.querySelectorAll('a[href*="/personnes/"]')
).map((link) => link.getAttribute("href").replace("/personnes/", ""));

const date = Array.from(doc.querySelectorAll(".CoverEpisode-date")).map(
(element) => element.textContent.trim().replace(/^[A-Za-z ]+/, "")
)[0];

return peopleLinks.map((d, index) => ({
url,
date: moment.utc(date, "DD MMMM YYYY", "fr").toDate(),
people: peopleLinks[index] || ""
}));
}
Insert cell
async function getToto(url) {
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 peopleLinks = Array.from(
doc.querySelectorAll('a[href*="/personnes/"]')
).map((link) => link.getAttribute("href").replace("/personnes/", ""));

return doc;
}
Insert cell
getToto(url)
Insert cell
moment.locales()
Insert cell
d3 = require("d3@6")
Insert cell
moment = require("moment")
Insert cell
// https://www.perplexity.ai/search/Question-sur-la-KWayVjPrTumFumeZ03up_g

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