Blogquiz is a perl script for scoring blog quizzes. The quiz itself goes on an accompanying html page. The source is free for any use, but requires cgi.
On The CGI Resource
Index I found a hit tracker that I can run myself: ratlog. I hacked it up a
bit to make it more like the hit-tracking service I used to use,
Gumball Tracker. You don't need SSI to run it, just CGI on some
server, somewhere. My version provides referring links and an option
of not tracking hits for users with the magic cookie - so I don't
track my own hits when I'm checking my pages. The tracker creates an
NCSA combined format log file for each day, with entries of the following
184.108.40.206 - - [18/Mar/2003:23:20:52 +0000] "GET http://jemimap.freeshell.org/moveabletype/ HTTP/1.1" 200 - "http://www.seema.org/blogger.html" "Mozilla/4.0 (compatible; MSIE 5.22; Mac_PowerPC)"
The first URL is the page that was hit. The second is the referring page. Browser information is included for each hit. I use Analog to analyze the log files every few months and one of their recommended tools to do the reverse DNS lookups quickly. (Analog will do them too, but slowly.) If you don't get many hits, you can just look through the raw files for what interests you.
Note that jptracker will not track hits on non-HTML pages
(such as images or XML pages). You can run it on any server; I have
it installed on Freeshell but it tracks hits on all my mirror sites as
well. If you are using a redirector you may lose the referrer
information, depending on how the redirector is configured. The hit
itself will still be tracked. If a user's browser does not allow
nor the referrer page will be recorded in the log. Here's an example
220.127.116.11 - - [17/Mar/2003:02:02:24 +0000] "GET HTTP/1.1" 200 - "" "Mozilla/3.01 (compatible;)"
The file jptracker.cgi is the main Perl script. You should put it in a cgi-capable directory. Check the path to perl. Two lines of the file need to be edited: Replace /local/logfile/path/ with a full UNIX path to the directory where the script will write the log files (preferably not in your web directory if you have non-web space available). Also, set the URL path of the transparent gif, which can go anywhere in your web directory - that is, replace /urlpath/to/gifs/ with the URL minus the domain (in my case, without http://jemimap.freeshell.org), and minus the actual filename (clear.gif). Don't forget to grab the transparent gif, clear.gif, and put it in an appropriate web location.
The HTML source is in jptrackerinsert.txt. You will need to change your.domain.here/yourcgidirectory/ to reflect the URL's you are using for jptracker.cgi and jptracker.txt. Once you've edited it to reflect your URL's, cut and paste this HTML into all the pages you want to track. I put it at the bottom of the page, right before the </body> tag. You can add the tracker to a blog by editing the blog template(s) and putting it somewhere near the bottom.
That's about it. If you have problems, feel free to email me.
The styleswitching script is complements of A List Apart. I use it with MovableType, but it could be set up for any web page that uses CSS stylesheets.
First, you need a set of stylesheets to switch between. For
used a couple that I had already made for MT, plus the full set of
seven from the MT website. Each of the stylesheets must be listed
in the header of the pages (that
is, at the top of each page template in MT - see the Technicolor instructions for the
full list of templates), in the usual place for LINK tags, and must
have a title element:
<link rel="stylesheet" href="<$MTBlogURL$>styles-site.css" type="text/css" title="Default" /> <link rel="alternate stylesheet" href="<$MTBlogURL$>mtclean.css" type="text/css" title="MT Clean" /> <link rel="alternate stylesheet" href="<$MTBlogURL$>mttrendy.css" type="text/css" title="MT Trendy" />
If you're using Mozilla, you can already switch between these
program to do the actual switching, styleswitcher.js.
it should be left in a separate file and loaded with a line in the
header (near the LINK tags) thus:
Next, you need the links that will run the program when clicked.
track of which style has been selected, and remembers it from page to
tags, but the switching links can be put on just the main page. These
HTML links call the function setActiveStyleSheet, according to the
title listed in the LINK tag:
<a href="#" onclick="setActiveStyleSheet('Clean'); return false;">Clean</a> <a href="#" onclick="setActiveStyleSheet('Trendy'); return false;">Trendy</a>
I tried a few other things with this script; you can read about them in my blog under Moveable Style in the web category. There are three entries in a row and some later ones regarding the nature of persistent, alternate and titled stylesheets.
Since people have asked, here's a little advice on installing Perl scripts, especially MovableType, on Freeshell. The main trouble is getting files over to Freeshell when you don't have ftp access and don't want to use zmodem. (Free accounts don't have ftp access.)
For something like MovableType, which is available on the web, you can use wget from the shell prompt on Freeshell, thus:
wget http://www.movabletype.org/url/to/downloadI don't know the real url, but you should be able to get one if you fill out the MT registration form.
Another option is to use the Lynx text browser on Freeshell to fill out the form on the main MT download page:
lynx http://www.movabletype.org/download.shtmland then it should let you do the download. This approach requires figuring out how to fill out forms in Lynx, which is pretty intuitive.
The other option is to email the gzipped file from your computer to your freeshell email account - that's what I used to do to upload new pages on my website before I got ftp access. You can save the attachment from pine to your main directory.
Once you have the MT files at freeshell you can follow the MT installation instructions to unzip it and install. You'll need a text editor to change the path to Perl, which on Freeshell is /usr/pkg/bin/perl, not the default that's in the files. (You'll need to do this for any perl script you upload to freeshell.) If you know vi or sed, you can use that to change the files, but I prefer Emacs. It's quick with a dired query-replace, but you can also edit the files individually. To save a file in emacs after you've edited it, use ctrl-x ctrl-s; to exit, use ctrl-x ctrl-c. Depending on your telnet terminal type, you may have to use the delete key instead of backspace in emacs. If it gets angry at you for using the backspace key, type ctrl-g (cancel).
I used the cgi-bin method of MT installation as explained in the directions, but I don't believe that's necessary on Freeshell - you can run scripts from any directory. You may have to write an .htaccess file in order to get cgi scripts to run in another directory, though - I don't know how that's configured for free accounts. If you need to know about .htaccess, you can read the Apache documentation, or just install all scripts in your cgi-bin directory.
Note that suwrap and cgiexec don't seem to be available on Freeshell. I'm not using the MySQL option, so I'm not sure whether that works.