Hi all... I plan on putting a PDF file on my web site for free down load. I would like to be able to know how many people look at it. How would you guys handle it? Thanks, JIM -- Jim Hatridge Linux User #88484 ------------------------------------------------------ WartHog Bulletin Info about new German Stamps http://www.fuzzybunnymilitia.org/~hatridge/bulletin Viel Feind -- Viel Ehr' Anti-US Propaganda stamp collection http://www.fuzzybunnymilitia.org/~hatridge/collection
On Friday 08 October 2004 17:19, James Hatridge wrote: Hi Jim,
Hi all...
I plan on putting a PDF file on my web site for free down load. I would like to be able to know how many people look at it. How would you guys handle it?
Take a look at webalizer. It will create all kinds of info, and make it readable for you. I use it here locally to check hits on my site. Mike -- Powered by SuSE 9.1 Kernel 2.6.4 KDE 3.2.1 Kmail 1.6.2 For SuSE Mondo/Mindi backup support go to http://www.mikenjane.net/~mike 6:15pm up 6 days 9:20, 4 users, load average: 2.03, 2.18, 2.18
On Friday 08 October 2004 17:19, James Hatridge wrote: Hi Jim,
Hi all...
I plan on putting a PDF file on my web site for free down load. I would like to be able to know how many people look at it. How would you guys handle it?
Take a look at webalizer. It will create all kinds of info, and make it readable for you. I use it here locally to check hits on my site.
You could also do this in PHP. click link send to countpage then let them download file. Very easy to do. I have some basic could on http://www.susenet.com. Go to the guide section each guide is counted for click throughs. If you need some basic steps email me, I can get it to you in a couple of days..... Neal
Mike
-- Powered by SuSE 9.1 Kernel 2.6.4 KDE 3.2.1 Kmail 1.6.2 For SuSE Mondo/Mindi backup support go to http://www.mikenjane.net/~mike 6:15pm up 6 days 9:20, 4 users, load average: 2.03, 2.18, 2.18
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On Friday 08 October 2004 17:19, James Hatridge wrote:
I plan on putting a PDF file on my web site for free down load. I would like to be able to know how many people look at it. How would you guys handle it?
A very simple form would be: grep /var/log/apache2/access_log "\"GET /server_path_to_pdf" | wc --lines (adjust directories and filenames to your own situation) Of course I presume you have access to your webserver logs. ;) Cheers, Leen
Leendert wrote regarding 'Re: [SLE] Down load count?' on Fri, Oct 08 at 12:59:
On Friday 08 October 2004 17:19, James Hatridge wrote:
I plan on putting a PDF file on my web site for free down load. I would like to be able to know how many people look at it. How would you guys handle it?
A very simple form would be:
grep /var/log/apache2/access_log "\"GET /server_path_to_pdf" | wc --lines
(adjust directories and filenames to your own situation)
Of course I presume you have access to your webserver logs. ;)
"grep -c" will print the number of lines matched without piping through wc. :) grep -c /var/log/apache2/access_log "GET /url/to/file.pdf" or egrep -c /var/log/apache2/access_log "GET .*/file.pdf" If you don't have log/server access beyond a file, you could write a CGI script (or similar) that makes an entry in a file, send you an email, puts somethign in a database, etc. Link to the CGI script, and have the CGI generate a redirect to the actual PDF. If someone finds the direct URL, they won't be counted, but you'll get a count of everyone who goes through the CGI. --Danny, a big fan of webalizer, BTW
On Friday 08 October 2004 21:33, Danny Sauer wrote:
Leendert wrote regarding 'Re: [SLE] Down load count?' on Fri, Oct 08 at 12:59:
On Friday 08 October 2004 17:19, James Hatridge wrote:
I plan on putting a PDF file on my web site for free down load. I would like to be able to know how many people look at it. How would you guys handle it?
A very simple form would be:
grep /var/log/apache2/access_log "\"GET /server_path_to_pdf" | wc --lines
(adjust directories and filenames to your own situation)
Of course I presume you have access to your webserver logs. ;)
"grep -c" will print the number of lines matched without piping through wc. :)
grep -c /var/log/apache2/access_log "GET /url/to/file.pdf" or egrep -c /var/log/apache2/access_log "GET .*/file.pdf"
If you don't have log/server access beyond a file, you could write a CGI script (or similar) that makes an entry in a file, send you an email, puts somethign in a database, etc. Link to the CGI script, and have the CGI generate a redirect to the actual PDF. If someone finds the direct URL, they won't be counted, but you'll get a count of everyone who goes through the CGI.
You can serve a stream of bytes through a php script. If the 'Content-Type' header is right, the other site will believe it is a .pdf file (or so). But boy, I hate those scripts. ;) I'd rather have a straight url of that .pdf file instead of having it served through a script. ;) Cheers, Leen
Leendert wrote regarding 'Re: [SLE] Down load count?' on Fri, Oct 08 at 15:29:
On Friday 08 October 2004 21:33, Danny Sauer wrote: [...]
If you don't have log/server access beyond a file, you could write a CGI script (or similar) that makes an entry in a file, send you an email, puts somethign in a database, etc. Link to the CGI script, and have the CGI generate a redirect to the actual PDF. If someone finds the direct URL, they won't be counted, but you'll get a count of everyone who goes through the CGI.
You can serve a stream of bytes through a php script. If the 'Content-Type' header is right, the other site will believe it is a .pdf file (or so).
Mmmm, header("content-type", $type); fpassthru($handle);... :)
But boy, I hate those scripts. ;) I'd rather have a straight url of that .pdf file instead of having it served through a script. ;)
That screws up the "save as" in some of the browsers I've used. Even if you specify an attachment name in the header, some browsers insist on saving to "redirect.php" or similar. Using a redirect works more reliably, and if you do a *real* redirect instead of something with a "meta refresh"-type behaviour, it's transparent to the user. --Danny
On Friday 08 October 2004 22:45, Danny Sauer wrote:
Leendert wrote regarding 'Re: [SLE] Down load count?' on Fri, Oct 08 at 15:29:
On Friday 08 October 2004 21:33, Danny Sauer wrote:
[...]
If you don't have log/server access beyond a file, you could write a CGI script (or similar) that makes an entry in a file, send you an email, puts somethign in a database, etc. Link to the CGI script, and have the CGI generate a redirect to the actual PDF. If someone finds the direct URL, they won't be counted, but you'll get a count of everyone who goes through the CGI.
You can serve a stream of bytes through a php script. If the 'Content-Type' header is right, the other site will believe it is a .pdf file (or so).
Mmmm, header("content-type", $type); fpassthru($handle);... :)
But boy, I hate those scripts. ;) I'd rather have a straight url of that .pdf file instead of having it served through a script. ;)
That screws up the "save as" in some of the browsers I've used. Even if you specify an attachment name in the header, some browsers insist on saving to "redirect.php" or similar. Using a redirect works more reliably, and if you do a *real* redirect instead of something with a "meta refresh"-type behaviour, it's transparent to the user.
You're right on target. :) I haven't played with this enough (or not at all?). I hope James gets it right. :) Cheers, Leen
participants (5)
-
Danny Sauer
-
James Hatridge
-
Leendert Meyer
-
Mike
-
suse-list@fresno.edu