iwla

iwla Commit Details

Date:2014-11-20 09:37:54 (6 years 8 months ago)
Author:Grégory Soutadé
Branch:dev, master
Commit:8ba8c99b3c86864153cd5acfad37abb021d2bdfc
Parents: 8c7f135741324ab7e1b0da15b1c3a50755a2a044
Message:WIP

Changes:
Mhooks/pre_analysis/H002_robot.py (1 diff)
Miwla.py (5 diffs)

File differences

hooks/pre_analysis/H002_robot.py
1111
1212
1313
14
15
16
14
15
16
1717
1818
1919
referers = 0
# 1) no pages view --> robot
if not super_hit['viewed_pages']:
super_hit['robot'] = 1
continue
# if not super_hit['viewed_pages']:
# super_hit['robot'] = 1
# continue
# 2) pages without hit --> robot
if not super_hit['viewed_hits']:
iwla.py
1212
1313
1414
15
15
1616
1717
1818
......
123123
124124
125125
126
126
127127
128128
129129
......
271271
272272
273273
274
275
274
276275
277276
278277
......
280279
281280
282281
283
284
282
285283
286284
287
288
285
289286
290287
291288
......
302299
303300
304301
305
306
307
302
308303
309304
310305
print '==> Start'
meta_visit = {'last_time':None}
meta_visit = {}
analyse_started = False
current_visits = {}
cache_plugins = {}
if status >= 300 and status < 400: return
if super_hit['robot'] or\
not int(hit['status']) in viewed_http_codes:
not status in viewed_http_codes:
page_key = 'not_viewed_pages'
hit_key = 'not_viewed_hits'
else:
cur_time = meta_visit['last_time']
if cur_time == None:
current_visits = deserialize(getDBFilename(t))
if not current_visits: current_visits = createEmptyVisits()
current_visits = deserialize(getDBFilename(t)) or createEmptyVisits()
analyse_started = True
else:
if not analyse_started:
return
else:
analyse_started = True
current_visits = deserialize(getDBFilename(t))
if not current_visits: current_visits = createEmptyVisits()
current_visits = deserialize(getDBFilename(t)) or createEmptyVisits()
if cur_time.tm_mon != t.tm_mon:
generateMonthStats()
current_visits = deserialize(getDBFilename(t))
if not current_visits: current_visits = createEmptyVisits()
current_visits = deserialize(getDBFilename(t)) or createEmptyVisits()
elif cur_time.tm_mday != t.tm_mday:
generateDayStats()
print '==> Analysing log'
meta_visit = deserialize(META_PATH)
if not meta_visit:
meta_visit = createEmptyMeta()
meta_visit = deserialize(META_PATH) or createEmptyMeta()
current_visits = createEmptyVisits()

Archive Download the corresponding diff file

Branches

Tags