Parent

Class/Module Index [+]

Quicksearch

Vizi::Visit

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

Attributes

duration[RW]
end_dt[RW]
expire_dt[RW]
hits[RW]
ip[RW]
pages[RW]
robots[RW]
searchphrase[RW]
start_dt[RW]
visitortype[RW]

Public Class Methods

new(ip, logdt, csuristem, csuriquery, p_visitortype, p_pageflag, p_searchphrase, visit_timeout) click to toggle source
# 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

Public Instance Methods

sendoutput() click to toggle source
# 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
update(logdt, csuriquery, p_visitortype, p_pageflag, p_searchphrase) click to toggle source
# 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

[Validate]

Generated with the Darkfish Rdoc Generator 2.