aboutsummaryrefslogtreecommitdiff
path: root/make_table.py
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2019-12-07 03:16:43 +0100
committerDaniel Schadt <kingdread@gmx.de>2019-12-07 03:16:43 +0100
commitc09d449902f529db6fe390b22307a237124410de (patch)
tree64c04077d2795ae4f288f4fed05e1996238d122c /make_table.py
parentd35534c0795caeda46e57fc515b74eba701110a2 (diff)
downloadkondou-c09d449902f529db6fe390b22307a237124410de.tar.gz
kondou-c09d449902f529db6fe390b22307a237124410de.tar.bz2
kondou-c09d449902f529db6fe390b22307a237124410de.zip
add chatlink + revenant legends support
Diffstat (limited to 'make_table.py')
-rw-r--r--make_table.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/make_table.py b/make_table.py
new file mode 100644
index 0000000..18a30fa
--- /dev/null
+++ b/make_table.py
@@ -0,0 +1,19 @@
+import requests
+import json
+from lxml import html, etree
+
+data = requests.get("https://wiki.guildwars2.com/wiki/Chat_link_format")
+parsed = html.fromstring(data.content)
+body = parsed.find(".//table")
+iterator = iter(body)
+next(iterator)
+result = []
+for row in iterator:
+ if "-" in row[3].text:
+ continue
+ ids = row[3].text.strip().split(";")
+ palette_id = int(row[4].text)
+ for skill_id in ids:
+ skill_id = int(skill_id)
+ result.append((skill_id, palette_id))
+print(json.dumps(result))