#!/bin/csh -f
###################################
# Look through the recent WWW access logs from the cismm.org machine to find who accessed the
# Image Surfer download.  These logs need to have been copied to
# ~taylorr/tmp/cismm.org_logs
###################################

cd /afs/unc/project/stm/archive/www_hits/imagesurfer.org_web_logs 

rm ~/tmp/surfer_total_list

foreach p (`ls imagesurfer_access_log*`)
	rm ~/tmp/surfer_list
	gunzip < $p | grep '/wp-content/plugins/download-monitor/download.php?id=ImageSurfer' | grep -v 152.2. | tee -a ~/tmp/surfer_list
	cat ~/tmp/surfer_list >>! ~/tmp/surfer_total_list
end

echo "Total number of unique off-site hits:"
cut -f1 -d" " ~/tmp/surfer_total_list | sort | uniq | wc

echo "Total number of weeks:"
ls access_log* | wc

echo "Months covered:"
cut -f2 -d"/" ~/tmp/surfer_total_list | sort | uniq

