Short but Sweet!

Because I am using the more tag in my entries, to limit the amount of text displayed on the initial page view, my home page is having a lot of blank space. To solve this problem I am using a Perl script to display quotes as filler for the white space. The script reads quotes from a play text file. I know Word Press has some plug in which can display quotes as well. I might explore it in the future and use it as a substitute to the Perl script.

Right now the Perl script will display a different quote on every page load. It is randomly picked from the text file. I am using the same script to display quotes at the top of both the Clan -(MP)- and Jus2 Investing web sites. On the Clan -(MP)- web site the quotes are displayed between the logo and the site menu. On the Jus2 Investing website the quotes are displayed on the right of the logo.

Below is the script source code. It is from the Perl Cookbook. You should have only one quote per line in your quote database file.

[perl]#!/usr/bin/perl -wT
use strict;
my $quote;
open(QUOTES, "./quotes.txt") or die "Oops! Can't find quote file: $!";
srand;
rand($.) < 1 && ($quote = $_) while ;
print "(anti-spam-content-type:) text/htmlnn";
print $quote;[/perl]

Popular posts from this blog

Messing with WordPress SPAM Bots

Validate Email Address [JavaScript]

How to setup Coda 2 to push to GitHub?