Published unlisted
Edited
Aug 17, 2022
1 fork
Insert cell
Insert cell
## Example

User Philippe rogez is a good example since he has created more than 1,000 articles in the French Wikipedia.
Insert cell
username = "Philippe rogez"
Insert cell
wikipedia = "fr.wikipedia.org"
Insert cell
Insert cell
data = d3.json(
"https://xtools.wmflabs.org/api/user/pages/" +
wikipedia +
"/" +
username +
"/0/noredirects/live"
)
Insert cell
Insert cell
df = aq.from(Object.values(data.pages))
Insert cell
Insert cell
data.continue
Insert cell
data1 = d3.json(
"https://xtools.wmflabs.org/api/user/pages/" +
wikipedia +
"/" +
username +
"/0/noredirects/live///" +
data.continue
)
Insert cell
data1.continue === undefined
Insert cell
Insert cell
get_pagescreated = async function (offset = "") {
return d3.json(
"https://xtools.wmflabs.org/api/user/pages/" +
wikipedia +
"/" +
username +
"/0/noredirects/live///" +
offset
);
}
Insert cell
get_pagescreated()
Insert cell
get_allpagescreated = async function (offset = "") {
const data = await get_pagescreated("");
if (data.continue === undefined) {
return data;
} else {
return await get_allpagescreated((offset = data.continue));
}
}
Insert cell
get_allpagescreated()
Insert cell
### Fetch paginate

https://andersdjohnson.github.io/fetch-paginate/

According to https://observablehq.com/@observablehq/Module-require-debugger, the import does not work.
Insert cell
### While
Insert cell
mutable offset = ""
Insert cell
while(offset !== undefined) {
data = get_pagescreated(offset)
console.log(data.continue)
offset = data.continue
}
Insert cell
Array.from({ length: 5 }, (_, index) => index + 1)
Insert cell
Insert cell
import { aq, op } from "@uwdata/arquero"
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