getReferences = async () => {
const references = [];
const notebooks = [
{owner: "mbostock", slug: "showing-progress"},
{owner: "observablehq", slug: "introduction-to-html"},
{owner: "tmcw", slug: "exploring-viewof"},
{owner: "observablehq", slug: "a-brief-introduction-to-viewof"},
{owner: "observablehq", slug: "introduction-to-generators"},
{owner: "mbostock", slug: "wait-until-button"},
{owner: "mootari", slug: "displaying-progress"},
{owner: "tmcw", slug: "progress-cell"},
{owner: "observablehq", slug: "introduction-to-views"},
{owner: "mbostock", slug: "fetch-progress"}
];
for (const {owner, slug} of notebooks) {
const notebookInfo = await getNotebookInfo(owner, slug);
const published = toDate(notebookInfo.publish_time);
let updated = toDate(notebookInfo.update_time);
if (updated === published) {
updated = null;
}
references.push({
published,
updated,
author: notebookInfo.creator.name,
title: notebookInfo.title,
url: `https://observablehq.com/@${notebookInfo.owner.login}/${notebookInfo.slug}`,
changes: notebookInfo.publish_version,
likes: notebookInfo.likes,
forks: notebookInfo.forks,
});
Promises.delay(1000);
}
return references;
}