fix regexps to discover geographical position of niggers
This commit is contained in:
parent
1a72642fa8
commit
239194bdf3
1 changed files with 6 additions and 4 deletions
|
|
@ -189,8 +189,10 @@ class AuMBrowser(BaseBrowser):
|
|||
self.my_id = int(r['user']['id'])
|
||||
self.my_name = r['user']['pseudo']
|
||||
|
||||
profile = self.get_profile(self.my_id)
|
||||
self.my_coords = [profile['lat'], profile['lng']]
|
||||
if self.my_coords == (0,0):
|
||||
profile = self.get_profile(self.my_id)
|
||||
if 'lat' in profile and 'lng' in profile:
|
||||
self.my_coords = [profile['lat'], profile['lng']]
|
||||
|
||||
return r
|
||||
|
||||
|
|
@ -326,10 +328,10 @@ class AuMBrowser(BaseBrowser):
|
|||
text = script.text
|
||||
if text is None:
|
||||
continue
|
||||
m = re.search('memberLat: ([\d\.]+),', text, re.IGNORECASE)
|
||||
m = re.search('memberLat: ([\-\d\.]+),', text, re.IGNORECASE)
|
||||
if m:
|
||||
profile['lat'] = float(m.group(1))
|
||||
m = re.search('memberLng: ([\d\.]+),', text, re.IGNORECASE)
|
||||
m = re.search('memberLng: ([\-\d\.]+),', text, re.IGNORECASE)
|
||||
if m:
|
||||
profile['lng'] = float(m.group(1))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue