1
0
Fork 0
forked from 0x2620/oxjs

update geo module

This commit is contained in:
rolux 2012-10-19 12:53:09 +02:00
commit 4da93006fc
6 changed files with 29 additions and 17 deletions

View file

@ -149,11 +149,11 @@ def get_country_data(country):
file = DATA['flag'][name] if DATA['flag'][name][-4:] == '.png' else DATA['flag'][name] + '.svg'
country['flagURL'] = get_flag('File:' + file)
else:
match = re.search('vertical-align:middle;?"( align="center")?><a href="/wiki/(File:.*?)"', html)
match = re.search('width:58%; vertical-align:middle;?"( align="center")?><a href="/w/index\.php\?title=(File:.*?)(&amp;page=1)?"', html)
if not match:
match = re.search('"/wiki/(File:Flag_.*?\.svg)"', html)
match = re.search('"/w/index\.php\?title=(File:Flag_.*?\.svg)(&amp;page=1)?"', html)
if match:
country['flagURL'] = get_flag(match.group(len(match.groups())))
country['flagURL'] = get_flag(match.group(len(match.groups()) - 1))
# google
if name in DATA['google']:
country['googleName'] = DATA['google'][name]