Add option count_hit_only_visitors and function isValidForCurrentAnalysis()
This commit is contained in:
@@ -18,24 +18,23 @@ class IWLAPreAnalysisRobots(IPlugin):
|
||||
# Basic rule to detect robots
|
||||
def hook(self):
|
||||
hits = self.iwla.getCurrentVisists()
|
||||
for k in hits.keys():
|
||||
super_hit = hits[k]
|
||||
|
||||
for (k, super_hit) in hits.items():
|
||||
if super_hit['robot']: continue
|
||||
|
||||
isRobot = False
|
||||
referers = 0
|
||||
|
||||
first_page = super_hit['requests'][0]
|
||||
if first_page['time_decoded'].tm_mday == super_hit['last_access'].tm_mday:
|
||||
for r in self.awstats_robots:
|
||||
if r.match(first_page['http_user_agent']):
|
||||
isRobot = True
|
||||
break
|
||||
if not self.iwla.isValidForCurrentAnalysis(first_page): continue
|
||||
|
||||
if isRobot:
|
||||
super_hit['robot'] = 1
|
||||
continue
|
||||
for r in self.awstats_robots:
|
||||
if r.match(first_page['http_user_agent']):
|
||||
isRobot = True
|
||||
break
|
||||
|
||||
if isRobot:
|
||||
super_hit['robot'] = 1
|
||||
continue
|
||||
|
||||
# 1) no pages view --> robot
|
||||
# if not super_hit['viewed_pages']:
|
||||
|
||||
Reference in New Issue
Block a user