Populate templates in wiki cache (done)
This commit is contained in:
parent
ea7383e3a3
commit
0b47d3cbcd
4 changed files with 8711 additions and 100 deletions
|
@ -5746,7 +5746,7 @@
|
||||||
* [CICADS 3301](https://www.pcgamingwiki.com/wiki/?curid=121541)
|
* [CICADS 3301](https://www.pcgamingwiki.com/wiki/?curid=121541)
|
||||||
* [Ciconia When They Cry - Phase 1: For You, the Replaceable Ones](https://www.pcgamingwiki.com/wiki/?curid=147627)
|
* [Ciconia When They Cry - Phase 1: For You, the Replaceable Ones](https://www.pcgamingwiki.com/wiki/?curid=147627)
|
||||||
* [Ciel Fledge](https://www.pcgamingwiki.com/wiki/?curid=75707)
|
* [Ciel Fledge](https://www.pcgamingwiki.com/wiki/?curid=75707)
|
||||||
* [Ciel Nosurge -Ushinawareta Hoshi e Sasagu Uta- DX](https://www.pcgamingwiki.com/wiki/?curid=165055)
|
* [Ciel Nosurge: Requiem for a Lost Star Deluxe](https://www.pcgamingwiki.com/wiki/?curid=165055)
|
||||||
* [Cinderella Dollhouse 2](https://www.pcgamingwiki.com/wiki/?curid=166682)
|
* [Cinderella Dollhouse 2](https://www.pcgamingwiki.com/wiki/?curid=166682)
|
||||||
* [Cinderella Free Fall](https://www.pcgamingwiki.com/wiki/?curid=172199)
|
* [Cinderella Free Fall](https://www.pcgamingwiki.com/wiki/?curid=172199)
|
||||||
* [Cinderella VR](https://www.pcgamingwiki.com/wiki/?curid=120974)
|
* [Cinderella VR](https://www.pcgamingwiki.com/wiki/?curid=120974)
|
||||||
|
@ -22110,7 +22110,7 @@
|
||||||
* [Pain Train PainPocalypse](https://www.pcgamingwiki.com/wiki/?curid=66824)
|
* [Pain Train PainPocalypse](https://www.pcgamingwiki.com/wiki/?curid=66824)
|
||||||
* [Pain-to-win](https://www.pcgamingwiki.com/wiki/?curid=82209)
|
* [Pain-to-win](https://www.pcgamingwiki.com/wiki/?curid=82209)
|
||||||
* [Painkiller: Redemption](https://www.pcgamingwiki.com/wiki/?curid=41012)
|
* [Painkiller: Redemption](https://www.pcgamingwiki.com/wiki/?curid=41012)
|
||||||
* [Paint it Back](https://www.pcgamingwiki.com/wiki/?curid=37181)
|
* [Paint It Back](https://www.pcgamingwiki.com/wiki/?curid=37181)
|
||||||
* [Paint It Black](https://www.pcgamingwiki.com/wiki/?curid=88142)
|
* [Paint It Black](https://www.pcgamingwiki.com/wiki/?curid=88142)
|
||||||
* [Paint Polygon](https://www.pcgamingwiki.com/wiki/?curid=67512)
|
* [Paint Polygon](https://www.pcgamingwiki.com/wiki/?curid=67512)
|
||||||
* [Paint Skills](https://www.pcgamingwiki.com/wiki/?curid=81522)
|
* [Paint Skills](https://www.pcgamingwiki.com/wiki/?curid=81522)
|
||||||
|
@ -24868,6 +24868,7 @@
|
||||||
* [Resistance is Fruitile](https://www.pcgamingwiki.com/wiki/?curid=135759)
|
* [Resistance is Fruitile](https://www.pcgamingwiki.com/wiki/?curid=135759)
|
||||||
* [ReSizE](https://www.pcgamingwiki.com/wiki/?curid=73213)
|
* [ReSizE](https://www.pcgamingwiki.com/wiki/?curid=73213)
|
||||||
* [Resized](https://www.pcgamingwiki.com/wiki/?curid=81673)
|
* [Resized](https://www.pcgamingwiki.com/wiki/?curid=81673)
|
||||||
|
* [Resonance of Fate 4K/HD Edition](https://www.pcgamingwiki.com/wiki/?curid=111442)
|
||||||
* [Resort](https://www.pcgamingwiki.com/wiki/?curid=145564)
|
* [Resort](https://www.pcgamingwiki.com/wiki/?curid=145564)
|
||||||
* [Resort Boss: Golf](https://www.pcgamingwiki.com/wiki/?curid=95549)
|
* [Resort Boss: Golf](https://www.pcgamingwiki.com/wiki/?curid=95549)
|
||||||
* [Respawn Man](https://www.pcgamingwiki.com/wiki/?curid=34135)
|
* [Respawn Man](https://www.pcgamingwiki.com/wiki/?curid=34135)
|
||||||
|
@ -28635,6 +28636,7 @@
|
||||||
* [Star Nomad](https://www.pcgamingwiki.com/wiki/?curid=49051)
|
* [Star Nomad](https://www.pcgamingwiki.com/wiki/?curid=49051)
|
||||||
* [Star Nomad 2](https://www.pcgamingwiki.com/wiki/?curid=45298)
|
* [Star Nomad 2](https://www.pcgamingwiki.com/wiki/?curid=45298)
|
||||||
* [Star Ocean: The Divine Force](https://www.pcgamingwiki.com/wiki/?curid=172590)
|
* [Star Ocean: The Divine Force](https://www.pcgamingwiki.com/wiki/?curid=172590)
|
||||||
|
* [Star Ocean: The Last Hope 4K & Full HD Remaster](https://www.pcgamingwiki.com/wiki/?curid=74363)
|
||||||
* [Star of Lemutia](https://www.pcgamingwiki.com/wiki/?curid=78110)
|
* [Star of Lemutia](https://www.pcgamingwiki.com/wiki/?curid=78110)
|
||||||
* [Star of Lemutia : Reborn](https://www.pcgamingwiki.com/wiki/?curid=153748)
|
* [Star of Lemutia : Reborn](https://www.pcgamingwiki.com/wiki/?curid=153748)
|
||||||
* [Star Phoenix](https://www.pcgamingwiki.com/wiki/?curid=53842)
|
* [Star Phoenix](https://www.pcgamingwiki.com/wiki/?curid=53842)
|
||||||
|
@ -32315,7 +32317,7 @@
|
||||||
* [The Wolf Among Us 2](https://www.pcgamingwiki.com/wiki/?curid=154605)
|
* [The Wolf Among Us 2](https://www.pcgamingwiki.com/wiki/?curid=154605)
|
||||||
* [The Woods](https://www.pcgamingwiki.com/wiki/?curid=91038)
|
* [The Woods](https://www.pcgamingwiki.com/wiki/?curid=91038)
|
||||||
* [The Woods: VR Escape the Room](https://www.pcgamingwiki.com/wiki/?curid=128342)
|
* [The Woods: VR Escape the Room](https://www.pcgamingwiki.com/wiki/?curid=128342)
|
||||||
* [The Word Is Not The Thing](https://www.pcgamingwiki.com/wiki/?curid=73957)
|
* [The Word Is Not the Thing](https://www.pcgamingwiki.com/wiki/?curid=73957)
|
||||||
* [The Works of Mercy](https://www.pcgamingwiki.com/wiki/?curid=55622)
|
* [The Works of Mercy](https://www.pcgamingwiki.com/wiki/?curid=55622)
|
||||||
* [The World 3: Rise of Demon](https://www.pcgamingwiki.com/wiki/?curid=54523)
|
* [The World 3: Rise of Demon](https://www.pcgamingwiki.com/wiki/?curid=54523)
|
||||||
* [The World II: Hunting Boss](https://www.pcgamingwiki.com/wiki/?curid=49384)
|
* [The World II: Hunting Boss](https://www.pcgamingwiki.com/wiki/?curid=49384)
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -84,7 +84,7 @@ async function main() {
|
||||||
if (args.steam) {
|
if (args.steam) {
|
||||||
await steamCache.refresh(
|
await steamCache.refresh(
|
||||||
args.skipUntil,
|
args.skipUntil,
|
||||||
args.irregularPathUntagged,
|
args.irregularPathUntagged ?? false,
|
||||||
args.limit ?? DEFAULT_GAME_LIMIT,
|
args.limit ?? DEFAULT_GAME_LIMIT,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,7 @@ export class WikiGameCacheFile extends YamlFile<WikiGameCache> {
|
||||||
async refresh(skipUntil: string | undefined, limit: number): Promise<void> {
|
async refresh(skipUntil: string | undefined, limit: number): Promise<void> {
|
||||||
let i = 0;
|
let i = 0;
|
||||||
let foundSkipUntil = false;
|
let foundSkipUntil = false;
|
||||||
|
const client = makeApiClient();
|
||||||
for (const pageTitle of Object.keys(this.data).sort()) {
|
for (const pageTitle of Object.keys(this.data).sort()) {
|
||||||
if (skipUntil && !foundSkipUntil) {
|
if (skipUntil && !foundSkipUntil) {
|
||||||
if (pageTitle === skipUntil) {
|
if (pageTitle === skipUntil) {
|
||||||
|
@ -79,7 +80,7 @@ export class WikiGameCacheFile extends YamlFile<WikiGameCache> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log(`Refreshing wiki page ${pageTitle}`);
|
// console.log(`Refreshing wiki page ${pageTitle}`);
|
||||||
await getGame(pageTitle, this.data);
|
await getGame(pageTitle, this.data, client);
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
if (limit > 0 && i >= limit) {
|
if (limit > 0 && i >= limit) {
|
||||||
|
@ -582,9 +583,9 @@ export async function getRecentChanges(newest: Date, oldest: Date): Promise<Rece
|
||||||
/**
|
/**
|
||||||
* https://www.pcgamingwiki.com/wiki/Template:Game_data
|
* https://www.pcgamingwiki.com/wiki/Template:Game_data
|
||||||
*/
|
*/
|
||||||
export async function getGame(pageTitle: string, cache: WikiGameCache): Promise<[string, Game]> {
|
export async function getGame(pageTitle: string, cache: WikiGameCache, client: Wikiapi = null): Promise<[string, Game]> {
|
||||||
console.log(pageTitle);
|
console.log(pageTitle);
|
||||||
const wiki = makeApiClient();
|
const wiki = client === null ? makeApiClient() : client;
|
||||||
let page = await wiki.page(pageTitle, { rvprop: "ids|content" });
|
let page = await wiki.page(pageTitle, { rvprop: "ids|content" });
|
||||||
if (page.missing !== undefined) {
|
if (page.missing !== undefined) {
|
||||||
// Couldn't find it by name, so try again by ID.
|
// Couldn't find it by name, so try again by ID.
|
||||||
|
|
Reference in a new issue