Do reverse DNS on feeds parsers
This commit is contained in:
parent
5c750e8b0c
commit
519033e474
|
@ -1,4 +1,4 @@
|
|||
v0.3 (20/12/2015)
|
||||
v0.3 (17/01/2016)
|
||||
** User **
|
||||
Add referers_diff display plugin
|
||||
Add year statistics in month details
|
||||
|
@ -15,13 +15,15 @@ v0.3 (20/12/2015)
|
|||
Add gz files support
|
||||
Add -z option (don't compress databases)
|
||||
Add own search enfines files
|
||||
Do reverse DNS on feeds parsers
|
||||
|
||||
** Dev **
|
||||
Add istats_diff interface
|
||||
Sort documentation output
|
||||
Add debug traces in robots plugin
|
||||
Update awstats data
|
||||
Dont count 'uri' and 'uri/' as differents uri
|
||||
Remove doule // at the end of URL
|
||||
Remove final slashes for referrers
|
||||
|
||||
** Bugs **
|
||||
Forgot <body> tag
|
||||
|
|
12
iwla.py
12
iwla.py
|
@ -289,6 +289,13 @@ class IWLA(object):
|
|||
self.logger.debug("False")
|
||||
return False
|
||||
|
||||
def isValidVisitor(self, hit):
|
||||
if hit['robot']: return False
|
||||
if not (conf.count_hit_only_visitors or\
|
||||
hit['viewed_pages']):
|
||||
return False
|
||||
return True
|
||||
|
||||
def _appendHit(self, hit):
|
||||
remote_addr = hit['remote_addr']
|
||||
|
||||
|
@ -596,10 +603,7 @@ class IWLA(object):
|
|||
|
||||
self.valid_visitors = {}
|
||||
for (k,v) in visits.items():
|
||||
if v['robot']: continue
|
||||
if not (conf.count_hit_only_visitors or\
|
||||
v['viewed_pages']):
|
||||
continue
|
||||
if self.isValidVisitor(v):
|
||||
self.valid_visitors[k] = v
|
||||
|
||||
duplicated_stats['nb_visitors'] = stats['nb_visitors'] = len(self.valid_visitors.keys())
|
||||
|
|
|
@ -64,9 +64,12 @@ class IWLAPostAnalysisReverseDNS(IPlugin):
|
|||
return True
|
||||
|
||||
def hook(self):
|
||||
hits = self.iwla.getValidVisitors()
|
||||
hits = self.iwla.getCurrentVisists()
|
||||
for (k, hit) in hits.items():
|
||||
if hit.get('dns_analysed', False): continue
|
||||
if not hit['feed_parser'] and\
|
||||
not self.iwla.isValidVisitor(hit):
|
||||
continue
|
||||
try:
|
||||
name, _, _ = socket.gethostbyaddr(k)
|
||||
hit['remote_addr'] = name.lower()
|
||||
|
|
|
@ -107,3 +107,5 @@ dumpHash(\%BrowsersHashIcon, $FIC, 1);
|
|||
print $FIC "}\n\n";
|
||||
|
||||
close($FIC);
|
||||
|
||||
print "Done !\n";
|
||||
|
|
Loading…
Reference in New Issue
Block a user