aboutsummaryrefslogtreecommitdiff
path: root/e621/parse.js
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2024-06-13 15:46:03 +0200
committerRaindropsSys <raindrops@equestria.dev>2024-06-13 15:46:03 +0200
commite44e2fe070484e06d384a31ef2699c3a2d5d474e (patch)
tree2d5eb5d1b01646270d18cf1f2d94519966d6e7de /e621/parse.js
downloadfaunerie-e44e2fe070484e06d384a31ef2699c3a2d5d474e.tar.gz
faunerie-e44e2fe070484e06d384a31ef2699c3a2d5d474e.tar.bz2
faunerie-e44e2fe070484e06d384a31ef2699c3a2d5d474e.zip
GitHub migration
Diffstat (limited to 'e621/parse.js')
-rwxr-xr-xe621/parse.js30
1 files changed, 30 insertions, 0 deletions
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));