diff --git a/bin/parse-wikia-monsters.py b/bin/parse-wikia-monsters.py index 74df6d3..c20040d 100755 --- a/bin/parse-wikia-monsters.py +++ b/bin/parse-wikia-monsters.py @@ -18,7 +18,6 @@ Returns list of dict, e.g.: import sys import re import json -from collections import defaultdict, OrderedDict import requests @@ -32,9 +31,12 @@ NAME_RE = re.compile( MONSTER_RE = re.compile( - '(?:)?\s*' + '(?:)?\s*' ']* title="([^"]*)"') +MONSTER_LINK_RE = re.compile( + '') JAPANESE_NAME_STR = '

Japanese:

' JAPANESE_NAME_RE = re.compile( @@ -57,8 +59,7 @@ def parse_wikia_monsters(f): continue if section != "Large Monsters": continue - m = MONSTER_RE.search(line) - if m: + for m in MONSTER_LINK_RE.finditer(line): monster = dict(href=m.group(1), name=m.group(2)) if monster["name"].startswith("File:"): continue @@ -71,7 +72,6 @@ def parse_wikia_monsters(f): def get_jp_names(monster_path): url = "http://monsterhunter.wikia.com" + monster_path r = requests.get(url) - html = r.text lines = r.text.split("\n") names = [] while lines: diff --git a/db/mhx_monster_list.json b/db/mhx_monster_list.json index 82543dc..6023d7a 100644 --- a/db/mhx_monster_list.json +++ b/db/mhx_monster_list.json @@ -59,6 +59,18 @@ "name": "Spearbreaker Daimyo Hermitaur", "name_jp": "\u77db\u7815\u30c0\u30a4\u30df\u30e7\u30a6\u30b6\u30b6\u30df" }, + { + "title_jp": "\u6050\u66b4\u7adc", + "href": "/wiki/Deviljho", + "name": "Deviljho", + "name_jp": "\u30a4\u30d3\u30eb\u30b8\u30e7\u30fc" + }, + { + "title_jp": "\u6050\u66b4\u7adc", + "href": "/wiki/Savage_Deviljho", + "name": "Savage Deviljho", + "name_jp": "\u6012\u308a\u55b0\u3089\u3046\u30a4\u30d3\u30eb\u30b8\u30e7\u30fc" + }, { "title_jp": "\u65ac\u7adc", "href": "/wiki/Dinovaldo", @@ -191,6 +203,18 @@ "name": "Raizekusu", "name_jp": "\u30e9\u30a4\u30bc\u30af\u30b9" }, + { + "title_jp": "\u91d1\u7345\u5b50", + "href": "/wiki/Rajang", + "name": "Rajang", + "name_jp": "\u30e9\u30fc\u30b8\u30e3\u30f3" + }, + { + "title_jp": "\u91d1\u7345\u5b50", + "href": "/wiki/Furious_Rajang", + "name": "Furious Rajang", + "name_jp": "\u6fc0\u6602\u3057\u305f\u30e9\u30fc\u30b8\u30e3\u30f3" + }, { "title_jp": "\u706b\u7adc", "href": "/wiki/Rathalos", diff --git a/web/translate/monster-titles.html b/web/translate/monster-titles.html index f0f96fb..812cd1f 100644 --- a/web/translate/monster-titles.html +++ b/web/translate/monster-titles.html @@ -235,6 +235,24 @@ +
+ +
恐暴竜
+ +
Deviljho
+
+ + + +
+ +
恐暴竜
+ +
Savage Deviljho
+
+ + +
悪相の千両役者
@@ -586,6 +604,24 @@ +
+ +
金獅子
+ +
Rajang
+
+ + + +
+ +
金獅子
+ +
Furious Rajang
+
+ + +
銀火竜
diff --git a/web/translate/monsters-en.html b/web/translate/monsters-en.html index f7e9c59..8c69a4c 100644 --- a/web/translate/monsters-en.html +++ b/web/translate/monsters-en.html @@ -290,6 +290,17 @@ +
+ +
Deviljho
+ +
イビルジョー
+ +
Title: 恐暴竜
+
+ + +
Dinovaldo
@@ -322,6 +333,17 @@
+ +
+ +
Furious Rajang
+ +
激昂したラージャン
+ +
Title: 金獅子
+
+ +
G
@@ -773,6 +795,17 @@ +
+ +
Rajang
+ +
ラージャン
+ +
Title: 金獅子
+
+ + +
Rathalos
@@ -862,6 +895,17 @@
S
+
+ +
Savage Deviljho
+ +
怒り喰らうイビルジョー
+ +
Title: 恐暴竜
+
+ + +
Seltas
diff --git a/web/translate/monsters-jp.html b/web/translate/monsters-jp.html index 83c9038..e55d3fc 100644 --- a/web/translate/monsters-jp.html +++ b/web/translate/monsters-jp.html @@ -148,6 +148,17 @@
+
+ +
イビルジョー
+ +
Deviljho
+ +
Title: 恐暴竜
+
+ + +
イャンガルルガ
@@ -941,6 +952,17 @@
+ +
+ +
ラージャン
+ +
Rajang
+ +
Title: 金獅子
+
+ +
@@ -1080,6 +1102,30 @@
+
+ +
+ +
怒り喰らうイビルジョー
+ +
Savage Deviljho
+ +
Title: 恐暴竜
+
+ + +
+ +
+ +
激昂したラージャン
+ +
Furious Rajang
+ +
Title: 金獅子
+
+ +