This class creates and stores information related to each visit Visits are determined on the basis of the IP Address hits during a timed interval
# File lib/vizi/vizi_tracker.rb, line 280 def initialize(ip, logdt, csuristem, csuriquery, p_visitortype, p_pageflag, p_searchphrase, visit_timeout) @ip = ip @start_dt = logdt @expire_dt = @start_dt + visit_timeout @end_dt = @start_dt @duration = 0 @hits = 1 @pages = 0 @pages = 1 if p_pageflag @visitortype = p_visitortype @robots = false @robots = true if csuristem == "/robots.txt" @visitortype = "S" if robots @searchphrase = "" @searchphrase = p_searchphrase if not p_searchphrase.nil? @pageids = [] z=(/(PageID)=(\d+)/).match(csuriquery) @pageids << z[2].to_i if not z.nil? # p csuriquery # p @pageids end
# File lib/vizi/vizi_tracker.rb, line 315 def sendoutput #if @pages > 0 iplong = @ip.to_s+" " p "> "+iplong[0..14]+" "+@start_dt.to_s[0..18]+" "+@visitortype+" Hits> "+@hits.to_s+" Pgs> "+@pages.to_s+" Dur> "+@duration.to_s+" Phrase> "+@searchphrase p @pageids #end end
# File lib/vizi/vizi_tracker.rb, line 302 def update(logdt, csuriquery, p_visitortype, p_pageflag, p_searchphrase) @end_dt = logdt @hits = @hits + 1 @pages = @pages + 1 if p_pageflag @duration = (@end_dt - @start_dt).to_i @visitortype = p_visitortype if @visitortype == "H" @searchphrase = p_searchphrase if not p_searchphrase.nil? z=(/(PageID)=(\d+)/).match(csuriquery) @pageids << z[2].to_i if not z.nil? # p csuriquery # p @pageids end
Generated with the Darkfish Rdoc Generator 2.