From e44e2fe070484e06d384a31ef2699c3a2d5d474e Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Thu, 13 Jun 2024 15:46:03 +0200 Subject: GitHub migration --- e621/parse.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 e621/parse.js (limited to 'e621/parse.js') diff --git a/e621/parse.js b/e621/parse.js new file mode 100755 index 0000000..b848708 --- /dev/null +++ b/e621/parse.js @@ -0,0 +1,30 @@ +const fs = require('fs'); + +let tags = require('./tags.json'); +let aliases = require('./tag_aliases.json'); +let final = {}; + +for (let tag of tags) { + final[tag.name] = { + id: tag.id, + allowedNames: [tag.name], + usage: tag.postCount, + category: tag.category, + derpibooruMatch: null + } +} + +for (let alias of aliases) { + if (alias.status === "deleted" || alias.status === "pending") continue; + + try { + let aliasedTag = final[alias.consequentName]; + aliasedTag.allowedNames.push(alias.antecedentName); + } catch (e) { + console.error(e); + console.log(alias); + return; + } +} + +fs.writeFileSync("parsed_tags.json", JSON.stringify(final, null, 2)); -- cgit