Click here to generate a new description.Aktivix is a Couldn't load adj1 Couldn't load groups of Couldn't load adj2 Couldn't load people who Couldn't load hope_verbs to Couldn't load enable_verbs Couldn't load other_people to Couldn't load do_verbs in aCouldn't load adverbs Couldn't load adj3 manner.
This is the code used to generate the page:
#!/usr/bin/perl -w
# nickl.pl: generate sentences that could be spoken by Richard Nickl
#
# Copyright (C) 2012 Josh Robinson, partly inspired by Jeff Ballard's
# bofhserver.pl
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# each of the filenames (those in quotes inside parentheses) refers
# to a plaintext file within http://www.srcf.ucam.org/~jmr59/nickl/ ,
# each one providing a word-array from which the variable words are
# selected each time the page is loaded.
srand(time);
$adj1=getstuff("adj1");
$noun1=getstuff("groups");
$adj2=getstuff("adj2");
$noun2=getstuff("people");
$verb1=getstuff("hope_verbs");
$verb2=getstuff("enable_verbs");
$noun3=getstuff("other_people");
$verb3=getstuff("do_verbs");
$adv=getstuff("adverbs");
$adj3=getstuff("adj3");
open(SOURCE,"nickl.pl") || die "No source code, dying!";
@source=<SOURCE>;
close(SOURCE);
print "Content-type: text/html\n";
print "\n";
print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
print '<html><head><title> The Uncollected Wisdom of Richard Nickl </title></head>';
print "<body><center><font size = \"+2\">";
print " <a href=\"http://www.srcf.ucam.org/~jmr59/nickl.pl\">Click here to generate a new description.</a></font>";
# Then the following line takes one variable from each word-array,
# pasting them each into the framework provided to get the text at
# the top of the page.
print "<p><font size = \"+2\">Aktivix is a $adj1 $noun1 of $adj2 $noun2 who $verb1 to $verb2 $noun3 to $verb3 in a$adv $adj3 manner.</font></p>";
print "<br /><br />";
print "<p><a id=\"source\" />This is the code used to generate the page:</p>";
print "<div style= \"font-family: courier, mono; text-align: left; white-space: pre;\">";
$gt = chr(38) . "gt";
$lt = chr(38) . "lt";
foreach (@source){
s/</$lt;/g;
s/>/$gt;/g;
print $_;
}
print "</div>";
print "<p><a href=\"http://validator.w3.org/check?uri=referer\"><img src=\"http://www.w3.org/Icons/valid-xhtml10\" alt=\"Valid XHTML 1.0!\" height=\"31\" width=\"88\" /></a></p>";
$close_html="/html";
print "</body><$close_html>\n";
exit(0);
sub getstuff(){
$filename=shift;
open(F, "$filename") || return "Couldn't load $filename";
$number=0;
@word_array=<F>;
close (F);
$number = $#word_array-1;
$to_return = $word_array[ (rand(1000)*$$)%($number+1) ] ;
chomp($to_return);
return $to_return;
}
