iwla

iwla Commit Details

Date:2014-11-27 13:07:14 (6 years 8 months ago)
Author:Grégory Soutadé
Branch:dev, master
Commit:5ccc63c7ae33101cb4185b3217e5b0114f186d29
Parents: e0d6b5dbbcfff919cf0c8dfcd71d7f4e51dc729b
Message:Add hasBeenViewed() function

Changes:
Miwla.py (1 diff)
Mplugins/post_analysis/top_downloads.py (1 diff)
Mplugins/pre_analysis/page_to_hit.py (2 diffs)

File differences

iwla.py
7979
8080
8181
82
83
84
8285
8386
8487
cur_time = self.meta_infos['start_analysis_time']
return (time.mktime(cur_time) <= time.mktime(request['time_decoded']))
def hasBeenViewed(self, request):
return int(request['status']) in conf.viewed_http_codes
def _clearMeta(self):
self.meta_infos = {
'last_time' : None
plugins/post_analysis/top_downloads.py
2121
2222
2323
24
25
26
2427
2528
26
2729
2830
2931
for (k, super_hit) in stats.items():
if super_hit['robot']: continue
for r in super_hit['requests']:
if not self.iwla.isValidForCurrentAnalysis(r) or\
not self.iwla.hasBeenViewed(r):
continue
if r['is_page']: continue
if not self.iwla.isValidForCurrentAnalysis(r): continue
if not int(r['status']) in viewed_http_codes: continue
plugins/pre_analysis/page_to_hit.py
1010
1111
1212
13
1413
1514
1615
......
2221
2322
2423
25
2624
2725
2826
2927
3028
29
30
31
3132
32
3333
3434
3535
def __init__(self, iwla):
super(IWLAPreAnalysisPageToHit, self).__init__(iwla)
self.API_VERSION = 1
self.conf_requires = ['viewed_http_codes']
def load(self):
# Remove logo from indefero
def hook(self):
hits = self.iwla.getCurrentVisists()
viewed_http_codes = self.iwla.getConfValue('viewed_http_codes')
for (k, super_hit) in hits.items():
if super_hit['robot']: continue
for request in super_hit['requests']:
if not self.iwla.isValidForCurrentAnalysis(request) or\
not self.iwla.hasBeenViewed(request):
continue
if not request['is_page']: continue
if not self.iwla.isValidForCurrentAnalysis(request): continue
uri = request['extract_request']['extract_uri']
for regexp in self.regexps:
if regexp.match(uri):

Archive Download the corresponding diff file

Branches

Tags