Skip to content

Instantly share code, notes, and snippets.

@berlysia
Last active December 17, 2015 10:18
Show Gist options
  • Save berlysia/5593589 to your computer and use it in GitHub Desktop.
Save berlysia/5593589 to your computer and use it in GitHub Desktop.
モバマス変換辞書生成器
# coding: utf-8
import urllib2,json,sys,codecs,cnvk
sys.stdin = codecs.getreader('utf-8')(sys.stdin)
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
response = urllib2.urlopen('http://www5164u.sakura.ne.jp/idols/profile.json?scope=all')
data = json.loads(response.read())
# data = json.load(open("profile.json"))
for l in data:
if "[" in l['name']:
l['name'] = l['name'].split("]")[1]
bd = l['birthday'].split("-")
print cnvk.convert(l['name_kana'],cnvk.KATA2HIRA,{u"ヴ":u"う゛"})+"\t"+cnvk.convert(l['name'],cnvk.Z_KATA)+u"\t固有人名\t"+l['attribute']+"/"+str(l['age'])+u"歳、"+str(l['height'])+u"cm、"+str(l['weight'])+u"kg、"+str(l['bust'])+"("+l['cup']+")-"+str(l['waist'])+"-"+str(l['hip'])+"/"+str(l['bmi'])+u"、"+str(int(bd[1]))+"/"+str(int(bd[2]))+"("+l['constellation']+u")、"+l['blood_type']+u"型、"+l['hometown']+u"出身、趣味:"+l['hobby']
@berlysia
Copy link
Author

berlysia commented Jun 8, 2013

https://github.com/yuka2py/cnvk を利用してます

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment