Published
Edited
Mar 4, 2022
Insert cell
Insert cell
viewof publishedBeforeFilter = Inputs.date({
value: "2019-01-01",
label: "Posts published before"
})
Insert cell
Insert cell
Insert cell
posts = owid.sql`select id,
printf("https://ourworldindata.org/%s", slug) as url,
title,
published_at,
updated_at
from posts
where "published_at" < ${timeFormatFn(
publishedBeforeFilter
)} order by updated_at`
Insert cell
sitemap = FileAttachment("owid-sitemap.xml").xml()
Insert cell
// print the name of the root element or error message
nodes = sitemap.querySelectorAll("urlset > url > loc")
Insert cell
sitemapUrls = new Set([...nodes.values()].map((item) => item.innerHTML))
Insert cell
timeFormatFn = d3.timeFormat("%Y-%m-%d")
Insert cell
postsInSitemap = posts.filter((post) => sitemapUrls.has(post.url))
Insert cell
owid = new DatasetteClient(
"https://owid-datasette-y43qr.ondigitalocean.app/owid"
)
Insert cell
import {DatasetteClient} from "@ambassadors/datasette-client"
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