From 173d247089661c28d0f4e1b957b9b65442900ac2 Mon Sep 17 00:00:00 2001 From: alex4401 Date: Thu, 25 Jul 2024 10:58:05 +0200 Subject: [PATCH] sites: streamlined script, 35 more --- scripts/add_site.py | 47 ++++++++++ sites.json | 221 +++++++++++++++++++++++++++++++++++++------- 2 files changed, 236 insertions(+), 32 deletions(-) create mode 100644 scripts/add_site.py diff --git a/scripts/add_site.py b/scripts/add_site.py new file mode 100644 index 0000000..872f794 --- /dev/null +++ b/scripts/add_site.py @@ -0,0 +1,47 @@ +import argparse +import bisect +import json + + +def add_wiki(args): + with open('sites.json', 'rt') as fp: + lists = json.load(fp) + + if not args.old_id and '-' in args.new_id: + print('id contains dashes... assuming old') + args.old_id = args.new_id.replace('-', '') + + entry = dict() + entry['id'] = args.new_id + if args.old_id: + entry['oldId'] = args.old_id + entry['name'] = args.name + if args.official: + entry['official'] = True + if args.old_name: + entry['search'] = dict( + oldName=args.old_name + ) + + print(json.dumps(entry, ensure_ascii=False)) + + if any(isinstance(x, dict) and x.get('oldId', x.get('id', None)) == (args.old_id or args.new_id) for x in lists): + print('id already present in the list - are you sure that this entry should be added? [y/n]', end=' ') + if input() != 'y': + return + + bisect.insort(lists, entry, key=lambda x: isinstance(x, dict) and x.get('id', None) or '____') + + with open('sites.json', 'wt', encoding='utf-8') as fp: + json.dump(lists, fp, indent='\t', ensure_ascii=False) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--old-id', type=str) + parser.add_argument('--old-name', type=str) + parser.add_argument('--new-id', type=str, required=True) + parser.add_argument('--name', type=str, required=True) + parser.add_argument('--official', action='store_true') + args = parser.parse_args() + add_wiki(args) diff --git a/sites.json b/sites.json index 43427eb..22b3425 100644 --- a/sites.json +++ b/sites.json @@ -51,11 +51,20 @@ "oldId": "13-sentinels-aegis-rim", "name": "13 Sentinels" }, + { + "id": "20minutestilldawn", + "oldId": "minutes-till-dawn", + "name": "20 Minutes Till Dawn" + }, + { + "id": "7daystodie", + "name": "7 Days to Die", + "official": true + }, { "id": "acecombat", "name": "Ace Combat", "official": true, - "search": { "oldName": "Acepedia" } @@ -90,7 +99,6 @@ "id": "ark", "name": "ARK", "official": true, - "search": { "oldName": "ARK: Survival Evolved", "newTitle": "ARK Official Community Wiki" @@ -99,7 +107,6 @@ { "parentRef": "ark", "oldId": "ark-survival-evolved", - "search": { "oldName": "ARK: Survival Evolved" } @@ -107,12 +114,19 @@ { "parentRef": "ark", "oldId": "ark-survival-evolved-archive", - "search": { "oldName": "ARK: Survival Evolved" } } ], + { + "id": "aground", + "name": "Aground" + }, + { + "id": "apexracer", + "name": "APEX Racer" + }, { "id": "arknights", "name": "Arknights" @@ -157,6 +171,11 @@ "id": "apexlegends", "name": "Apex Legends" }, + { + "id": "astralparty", + "oldId": "starparty", + "name": "Astral Party" + }, { "id": "backpackbattles", "oldId": "backpack-battles", @@ -171,6 +190,14 @@ "id": "bakegg", "name": "Bake.gg" }, + { + "id": "bananapedia", + "oldId": "supermonkeyball", + "name": "Bananapedia", + "search": { + "oldName": "Super Monkey Ball" + } + }, { "id": "battlebit", "oldId": "battlebit", @@ -187,7 +214,6 @@ "oldId": "battletabs-io", "name": "BattleTabs", "official": true, - "search": { "oldName": "BattleTabs.io" } @@ -220,11 +246,29 @@ "id": "bejeweled", "name": "Bejeweled" }, + { + "id": "bfdibranches", + "oldId": "bfdi-branches", + "name": "BFDI: Branches", + "official": true + }, + { + "id": "blackreliquary", + "name": "The Black Reliquary" + }, { "id": "bleed", "oldId": "bleed-game", "name": "Bleed" }, + { + "id": "blockfront", + "oldId": "blockfrontmc", + "name": "BlockFront", + "search": { + "oldName": "BlockFrontMC" + } + }, { "id": "boomslingers", "oldId": "boom-slingers", @@ -255,7 +299,6 @@ "id": "bellasara", "oldId": "thebellasara", "name": "Bella Sara", - "search": { "oldName": "The Bella Sara" } @@ -282,7 +325,6 @@ "id": "chivalry", "name": "Chivalry", "official": true, - "search": { "oldName": "Chivalry: Medieval Warfare" } @@ -401,6 +443,13 @@ "id": "d2mc", "name": "Destiny 2 Minecraft Edition" }, + { + "id": "deltatraveler", + "name": "DELTATRAVELER", + "search": { + "oldName": "The Unofficial Deltatraveler" + } + }, { "id": "dredge", "name": "Dredge" @@ -432,6 +481,10 @@ "name": "Do Not Feed The Monkeys 2099", "official": true }, + { + "id": "dragonfable", + "name": "DragonFable" + }, { "id": "dungeonnowloading", "oldId": "dungeon-now-loading", @@ -496,12 +549,12 @@ "id": "ena", "oldId": "enajoelg", "name": "ENA" - }, + }, { "id": "erenshor", "name": "Erenshor", "official": true - }, + }, { "id": "exapico", "oldId": "artonelico", @@ -512,11 +565,16 @@ "name": "Enter The Gungeon", "official": true }, + { + "id": "eternitydev", + "oldId": "eternitydev-games", + "name": "EternityDev" + }, { "id": "everdreamvalley", "name": "Everdream Valley", "official": true - }, + }, { "id": "fantasylife", "oldId": "fantasy-life", @@ -541,7 +599,6 @@ "id": "fearandhunger", "name": "Fear and Hunger", "official": true, - "search": { "oldName": "\"Fear and Hunger: the Tormentpedia\"" } @@ -566,7 +623,6 @@ { "parentRef": "fiendfolio", "oldId": "fiend-folio-afterbirth", - "search": { "oldName": "Fiend Folio Afterbirth+" } @@ -622,6 +678,12 @@ "id": "ghostrunner", "name": "Ghostrunner" }, + { + "id": "ghostwatchers", + "oldId": "ghost-watchers", + "name": "Ghost Watchers", + "official": true + }, { "id": "gigantic", "name": "Gigantic" @@ -669,15 +731,14 @@ }, [ { - "id": "helldivers", - "oldId": "helldivers", - "name": "Helldivers" + "id": "helldivers", + "oldId": "helldivers", + "name": "Helldivers" }, { "parentRef": "helldivers", "oldId": "helldivers-ii" }, - { "parentRef": "helldivers", "oldId": "helldivers-archive" @@ -703,10 +764,21 @@ "id": "holocure", "name": "Holocure" }, + { + "id": "hyboriangates", + "name": "Hyborian Gates", + "search": { + "oldName": "Hyborian gates" + } + }, { "id": "hybridanimals", "name": "Hybrid Animals" }, + { + "id": "hytale", + "name": "Hytale" + }, { "id": "idlewizard", "name": "Idle Wizard", @@ -950,6 +1022,11 @@ "uiClass": "wiki-indent" } ], + { + "id": "minehut", + "oldId": "minehutmc", + "name": "Minehut" + }, { "id": "minihealer", "name": "MiniHealer", @@ -964,6 +1041,13 @@ "id": "momodora", "name": "Momodora" }, + { + "id": "monsternevercry", + "name": "Monster Never Cry", + "search": { + "oldName": "Monsternevercry" + } + }, { "id": "monumenta", "oldId": "monumentammo", @@ -1011,7 +1095,6 @@ "id": "oldworldblues", "oldId": "old-world-blues", "name": "Old World Blues", - "search": { "oldName": "HOI4 total conversion mod" } @@ -1044,7 +1127,7 @@ "id": "pathologic", "name": "Pathologic", "official": true - }, + }, { "id": "palia", "name": "Palia", @@ -1164,12 +1247,21 @@ { "parentRef": "roody2d", "oldId": "roody-2d", - "search": { "oldName": "Roody:2D ReEdit" } } ], + { + "id": "pvzneighborhooddefense", + "oldId": "pvz-neighborhood-defense", + "name": "PvZ Neighborhood Defense", + "official": true + }, + { + "id": "rlcraft", + "name": "RLCraft" + }, { "id": "rootsofpacha", "name": "Roots of Pacha", @@ -1179,6 +1271,11 @@ "id": "rsmc", "name": "RSMC" }, + { + "id": "samuraigunn2", + "oldId": "samurai-gunn-2", + "name": "Samurai Gunn 2" + }, { "id": "sandboxels", "name": "Sandboxels", @@ -1218,6 +1315,14 @@ "oldId": "secrets-of-grindea" } ], + { + "id": "originrealms", + "name": "Origin Realms" + }, + { + "id": "scorn", + "name": "Scorn" + }, { "id": "sheltered2", "oldId": "sheltered-2", @@ -1241,6 +1346,11 @@ "id": "slycooper", "name": "Sly Cooper" }, + { + "id": "smallandsurvivethewilds", + "oldId": "smalland-survive-the-wilds", + "name": "Smalland: Survive the Wilds" + }, { "id": "smileforme", "oldId": "smile-for-me", @@ -1285,6 +1395,11 @@ "name": "Steamworld", "official": true }, + { + "id": "strinova", + "name": "Strinova", + "official": true + }, { "id": "synthetikuniverse", "oldId": "synthetik", @@ -1301,6 +1416,14 @@ "name": "Sun Haven", "official": true }, + { + "id": "sunnyside", + "oldId": "sunnysidegame", + "name": "SunnySide", + "search": { + "oldName": "SunnySide Game" + } + }, { "id": "superautopets", "name": "Super Auto Pets" @@ -1401,7 +1524,6 @@ "oldId": "tboi-epiphany", "name": "Epiphany", "uiClass": "wiki-indent", - "search": { "oldName": "TBOI: The Epiphany Mod" } @@ -1411,7 +1533,6 @@ "name": "Forgotten Fables", "official": true, "uiClass": "wiki-indent", - "search": { "oldName": "The Binding of Isaac: Forgotten Fables" } @@ -1453,6 +1574,26 @@ "oldId": "titanfall2" } ], + { + "id": "smash-legends", + "oldId": "smashlegends", + "name": "Smash Legends" + }, + { + "id": "surroundead", + "name": "SurrounDead", + "official": true + }, + { + "id": "thecrust", + "oldId": "the-crust", + "name": "The Crust" + }, + { + "id": "thewolf", + "oldId": "the-wolf-simulator", + "name": "The Wolf" + }, { "id": "timberborn", "name": "Timberborn", @@ -1462,7 +1603,6 @@ "id": "tomclancy", "oldId": "jackryan", "name": "Tom Clancy", - "search": { "oldName": "Jack Ryan" } @@ -1481,9 +1621,9 @@ }, [ { - "id": "trucksimulator", - "oldId": "truck-simulator", - "name": "Truck Simulator" + "id": "trucksimulator", + "oldId": "truck-simulator", + "name": "Truck Simulator" }, { "parentRef": "trucksimulator", @@ -1535,13 +1675,12 @@ "id": "tvruhh", "oldId": "the-void-rains-upon-her-heart", "name": "The Void Rains Upon Her Heart" - }, + }, [ { "id": "loathing", "oldId": "westofloathing", "name": "Wiki of Loathing", - "search": { "oldName": "West of Loathing", "newIncludesWiki": true @@ -1550,16 +1689,24 @@ { "parentRef": "loathing", "oldId": "shadowsoverloathing", - "search": { "oldName": "Shadows Over Loathing" }, - "rewritePages": { "Shadows_Over_Loathing_Wiki": "Wiki_of_Loathing" } } ], + { + "id": "uhctherenaissance", + "oldId": "uhc-the-renaissance", + "name": "Minecraft UHC: The Renaissance", + "official": true + }, + { + "id": "unbeatable", + "name": "UNBEATABLE" + }, { "id": "vtolvr", "oldId": "vtol-vr", @@ -1570,6 +1717,10 @@ "id": "voidigo", "name": "Voidigo" }, + { + "id": "wakfu", + "name": "Wakfu" + }, { "id": "warcommander", "name": "War Commander" @@ -1579,7 +1730,6 @@ "id": "warcraft", "oldId": "wowpedia", "name": "Warcraft", - "search": { "oldName": "Wowpedia", "newIncludesWiki": true @@ -1588,7 +1738,6 @@ { "parentRef": "warcraft", "oldId": "wowwiki-archive", - "search": { "oldName": "WowWiki" } @@ -1598,6 +1747,10 @@ "id": "wautah", "name": "Weird and Unfortunate Things Are Happening" }, + { + "id": "wildfire", + "name": "Wildfire" + }, { "id": "wynncraft", "name": "Wynncraft", @@ -1652,8 +1805,12 @@ "oldId": "xform-games", "name": "Xform Games" }, + { + "id": "yokaiwatch", + "name": "Yo-kai Watch" + }, { "id": "zeldacraft", "name": "Zeldacraft" } -] +] \ No newline at end of file