Add quickfacts-box to wikipedia article

This commit is contained in:
Pieter Vander Vennet 2021-10-18 20:40:24 +02:00
parent c1d21fcbe5
commit 902f32ba4b
14 changed files with 343 additions and 50 deletions

16
test.ts
View file

@ -1,5 +1,13 @@
import FeaturedMessage from "./UI/BigComponents/FeaturedMessage";
import Combine from "./UI/Base/Combine";
import * as wd from "wikidata-sdk"
import * as wds from "wikibase-sdk"
import {Utils} from "./Utils";
new FeaturedMessage().AttachTo("maindiv")
new Combine(FeaturedMessage.WelcomeMessages().map(wm => FeaturedMessage.CreateFeaturedBox(wm))).AttachTo("extradiv")
const url = wd.getEntities(["Q42"])
console.log(url)
Utils.downloadJson(url).then(async (entities) => {
//const parsed = wd.parse.wb.entities(entities)["Q42"]
console.log(entities)
console.log(wds.simplify.entity(entities.entities["Q42"], {
timeConverter: 'simple-day'
}))
})