Get GEO code for all visits (not only valid ones)
This commit is contained in:
parent
dadd0c9029
commit
8255be7ec8
|
@ -69,10 +69,10 @@ class IWLADisplayTopGeo(IPlugin):
|
||||||
def FlagFilter(host, self):
|
def FlagFilter(host, self):
|
||||||
cc = None
|
cc = None
|
||||||
host_name = host.split(' ')[0] # hostname or ip
|
host_name = host.split(' ')[0] # hostname or ip
|
||||||
if host_name in self.valid_visitors.keys():
|
if host_name in self.visitors.keys():
|
||||||
cc = self.valid_visitors[host_name].get('country_code', None)
|
cc = self.visitors[host_name].get('country_code', None)
|
||||||
else:
|
else:
|
||||||
for visitor in self.valid_visitors.values():
|
for visitor in self.visitors.values():
|
||||||
if visitor['remote_addr'] == host_name:
|
if visitor['remote_addr'] == host_name:
|
||||||
cc = visitor.get('country_code', None)
|
cc = visitor.get('country_code', None)
|
||||||
break
|
break
|
||||||
|
@ -84,7 +84,7 @@ class IWLADisplayTopGeo(IPlugin):
|
||||||
display = self.iwla.getDisplay()
|
display = self.iwla.getDisplay()
|
||||||
geo = self.iwla.getMonthStats().get('geo', {})
|
geo = self.iwla.getMonthStats().get('geo', {})
|
||||||
geo = sorted(geo.items(), key=lambda t: t[1], reverse=True)
|
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
|
# All in a page
|
||||||
if self.create_geo_page:
|
if self.create_geo_page:
|
||||||
|
|
|
@ -71,7 +71,7 @@ class IWLAPostAnalysisIPToGeo(IPlugin):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def hook(self):
|
def hook(self):
|
||||||
visitors = self.iwla.getValidVisitors()
|
visitors = self.iwla.getCurrentVisits()
|
||||||
month_stats = self.iwla.getMonthStats()
|
month_stats = self.iwla.getMonthStats()
|
||||||
|
|
||||||
geo = month_stats.get('geo', {})
|
geo = month_stats.get('geo', {})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user