iwla

iwla Commit Details

Date:2017-09-06 07:43:55 (2 years 10 months ago)
Author:Grégory Soutadé
Branch:dev, master
Commit:8255be7ec806ffdcc7eca01a880459c4b2e4698f
Parents: dadd0c90290725eb84aebf071d43992a872c9058
Message:Get GEO code for all visits (not only valid ones)

Changes:
Mplugins/display/ip_to_geo.py (2 diffs)
Mplugins/post_analysis/ip_to_geo.py (1 diff)

File differences

plugins/display/ip_to_geo.py
6969
7070
7171
72
73
72
73
7474
75
75
7676
7777
7878
......
8484
8585
8686
87
87
8888
8989
9090
def FlagFilter(host, self):
cc = None
host_name = host.split(' ')[0] # hostname or ip
if host_name in self.valid_visitors.keys():
cc = self.valid_visitors[host_name].get('country_code', None)
if host_name in self.visitors.keys():
cc = self.visitors[host_name].get('country_code', None)
else:
for visitor in self.valid_visitors.values():
for visitor in self.visitors.values():
if visitor['remote_addr'] == host_name:
cc = visitor.get('country_code', None)
break
display = self.iwla.getDisplay()
geo = self.iwla.getMonthStats().get('geo', {})
geo = sorted(geo.items(), key=lambda t: t[1], reverse=True)
self.valid_visitors = self.iwla.getValidVisitors()
self.visitors = self.iwla.getCurrentVisits()
# All in a page
if self.create_geo_page:
plugins/post_analysis/ip_to_geo.py
7171
7272
7373
74
74
7575
7676
7777
return True
def hook(self):
visitors = self.iwla.getValidVisitors()
visitors = self.iwla.getCurrentVisits()
month_stats = self.iwla.getMonthStats()
geo = month_stats.get('geo', {})

Archive Download the corresponding diff file

Branches

Tags