Quote Of The Day Perl script

This is a simple Perl/CGI script that lets you add a quote of the day to your website.
Take a look at the example here (may not be for the faint of heart).

Download

Latest version can be found at http://theory.org/~matt/perl/qotd/qotd.tar.gz
Contains the following files:
Files Description
qotd The Quote of the Day script
mknewpass.pl A script that crypts a password
for the qotd script to use
add.html
qotd.html
archive-item.html
archive.html
HTML template files for the script

Installation

  1. Make sure you have Perl 5, anyDBM, and CGI.
  2. Set up the configuration variables.
  3. Make a password using mknewpass.pl, and put it in the qotd script.
  4. Make sure the $qroot directory is world writable.
  5. Put the qotd file in your cgi-bin.
  6. Go to http://www.myserver.com/cgi-bin/qotd?mode=add, and add the first quote.
  7. If everything works OK, you can now change your $qroot directory so that it is not world-writable, taking care to leave the qotd.db file writable by the uid that the webserver runs under.
  8. Edit the template files to your heart's content.

Configuration Variables

$wwwroot = "/var/www/";
This is the web root directory; the directory where your webserver looks for your website.

$qroot = $wwwroot."/perl/qotd/";
This is the base directory for the quote of the day script. This is the directory where your template files and quote of the day database will be stored.

$dbfile = $qroot."qotd";
This is the name of the dbm file that stores quotes of the day. This is provided for convenience and probably won't need to be changed.

$password = "pwEqn54BuyKy2";
This is a crypted password. This password is required to add a quote but not to view the quotes. You will want to use the mknewpass.pl script to generate a password of your own.

Making New Passwords

The password for adding a new quote is stored in an encrypted form ( using the perl "crypt" function ) inside the script. Because of this, you will need to use the mknewpass.pl program included with this package to create a password for yourself. Just run the program, enter a password, and you will get a crypted value back. It will look something like "pwEqn54BuyKy2". Copy this into the qotd script, into the $password configuration variable.

Template Files

The template files are HTML files that the script uses as templates for displaying the Quote of the Day(qotd.html), the archive of previous quotes(archive.html and archive-item.html) and the add a new quote page(add.html). Each file has several "keywords" in it, like "QUOTE" or "WHO" or "DATE." The script replaces these keywords with actual quotes, names, or dates when it is displaying information. You can edit these files to reflect the general look of your site, background colors and patterns, headers, footers, whatever.

Disclaimer

This product is © 1999 Matt Chisholm. It is freely redistributable under the terms of the GNU General Public License. Please feel free to email me at matt (at) theory.org if you have any questions or features you would like to see. I hope you enjoy it.


Last modified: Wed Nov 9 00:44:42 PST 2005