perleager has asked for the wisdom of the Perl Monks concerning the following question:

Hello:

I really want to learn how to keep track of how long a visitor stays at ure website.

Can Perl carry out this job?

I want to learn how to do this because im charging visitors on how long they view a streaming video cam. (The streaming video is not on my server and infact on theirs)

My site allows people with streaming video cam to charge visitors (we take care of the billing etc. for them and we give them visitors)

If any ref. to this subject, I would really appreciate it.

Thanks

Replies are listed 'Best First'.
Re: Keeping time
by Masem (Monsignor) on Jul 18, 2001 at 15:30 UTC
    There's no way to do this with HTML. At least, no way without a lot of error problems, incompatibility with browsers, etc.

    It's probably better to look at your streaming software and try to determine from that how long a stream has been served, possibly backending it with perl and the web server to determine whom the person viewing is, so that you can charge correctly. But any solution solely based on just the web server and HTML is prone to errors, both in your favor (overcharging) and against (under/no charge).


    Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
Re: Keeping time
by MZSanford (Curate) on Jul 18, 2001 at 13:01 UTC
    There was some talk in the Chatterbox about soemthing simlar to this, and if i recall there were a few suggestions. The best i have are :

        Use the OnLoad and OnUnload DHTML funtions to hit a site that records the information. The problem with this is that if the close the browser rather that leave the site, it will not register the exit, and wil continue to charge (not good).

        Use the websever logs. Many times they contain the connect and disconnect times, which could be cross references based on the IP.

        And, because connection speeds vary, if you have access to the amount of data sent, i would think tht that would be preferrable to time, but depends on the application <cough>porn</cough>.

    Hope that helps
    OH, a sarcasm detector, that’s really useful
Re: Keeping time
by rrwo (Friar) on Jul 19, 2001 at 01:35 UTC

    If the streaming cam involves reloaded graphics frames, why not use cookies? (Yes, you can send cookies for graphics.) They're also useful to validate that the user has authorization to view the webcam. Note: graphics must come from the same server as the cookies, so you'd have to reroute feeds. Minor issue, of course.