Public
Edited
Sep 3, 2023
Insert cell
Insert cell
ORG = 'amx-project'
Insert cell
REPO = 'kuwanauchi11saitama2023'
Insert cell
list0 = fetch(`https://api.github.com/repos/${ORG}/${REPO}/contents`).then((resp) => resp.json())
Insert cell
// この取り方だと上限 1000 にかかってしまい、うまくいきません。
list1 = fetch(`https://api.github.com/repos/${ORG}/${REPO}/contents/xml`).then((resp) => resp.json())
Insert cell
list2 = fetch(`https://api.github.com/repos/${ORG}/${REPO}/git/trees/75bd5db06144e64fa7bac481cc328c8aa1e5101f`).then((resp) => resp.json())
Insert cell
// これがファイルのリストになります
list3 = list2.tree.map(o => `${Math.round(o.size / 1024)}KiB https://raw.githubusercontent.com/${ORG}/${REPO}/main/xml/${o.path}`)
Insert cell
list0.find(o => {return o.name == "xml"}).sha
Insert cell
Insert cell
jszip = require("jszip@3/dist/jszip.min.js")
Insert cell
archive = fetch(`https://raw.githubusercontent.com/${ORG}/${REPO}/main/xml/11102-0300-17.zip`)
.then(resp => resp.arrayBuffer())
.then(buffer => jszip.loadAsync(buffer))
Insert cell
archive.file(Object.keys(archive.files)[0]).async("text")
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