From aaa9d76db026c832bfdd936c4069128bde6b7311 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 17 Aug 2018 23:29:48 +0300 Subject: [PATCH] Some tweaks to skill gem scraping Better tagging for categories Don't output drop-only gems in the price categories --- scrape-wiki-data.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scrape-wiki-data.py b/scrape-wiki-data.py index b12f8a6..470d282 100755 --- a/scrape-wiki-data.py +++ b/scrape-wiki-data.py @@ -382,28 +382,28 @@ def main(): sys.stdout.write(prefix) out = open("skillgems.txt", "w") - out.write('category "skillgem.vaal"\n{\n\tclass "Skill Gem";\n\tor\n\t{\n') + out.write('category "skillgem.special.vaal"\n{\n\tclass "Skill Gem";\n\tor\n\t{\n') for g in gems: if g.vaal: out.write('\t\tbase_type "{}";\n'.format(g.name)) out.write("\t};\n};\n") - out.write('category "skillgem.drop"\n{\n\tclass "Skill Gem";\n\tor\n\t{\n') + out.write('category "skillgem.special.drop"\n{\n\tclass "Skill Gem";\n\tor\n\t{\n') for g in gems: if (g.drop_only or not g.price) and not g.vaal: out.write('\t\tbase_type "{}";\n'.format(g.name)) out.write("\t};\n};\n") for p, n in SkillGemParser.prices: - out.write('category "skillgem.{}"\n'.format(p)) + out.write('category "skillgem.price.{}"\n'.format(p)) out.write('{\n\tclass "Skill Gem";\n\tor\n\t{\n') for g in gems: - if g.price==p: + if not g.drop_only and g.price==p: out.write('\t\tbase_type "{}";\n'.format(g.name)) out.write("\t};\n};\n") for a in ["strength", "dexterity", "intelligence"]: - out.write('category "skillgem.{}"\n'.format(a)) + out.write('category "skillgem.attribute.{}"\n'.format(a)) out.write('{\n\tclass "Skill Gem";\n\tor\n\t{\n') for g in gems: if g.primary_attribute==a: -- 2.45.2