#!/usr/bin/python """Novelblurb.py Write your own adventure-thriller book jacket blurb! Hastily constructed by Kris Schnee during a boring plane flight. License: Free software; do whatever with it. Sample output: A dark mystery. A jarring secret. Dex, an industrial spy, finds himself haunted by a bizarre run of bad luck when a gang of assassins strikes. Now Dex must join forces with the shocking Summer Team to uncover the conspiracy. The journey takes them from Pennsylvania's Amish country to a convention for animal fanatics and finally to the galaxy's edge itself. But the true danger may prove to be the beginning of the end for humanity... """ from cgitool import * AMAZING = ["amazing","ancient","brilliant","coded","corrupted","cruel","crumbling","dark","decaying","encrypted","factuous","forbidden","foreboding","hidden","jarring","labyrinthine","legendary","meddling","nefarious","perilous","secret","shocking","startling","suspicious","Templar","twisted"] SECRET = ["artifact","battle","beast","bloodline","city","conspiracy","curse","discovery","disease","duty","enigma","feud","god","hatred","killer","legacy","loyalty","machine","monster","mystery","pact","riddle","saga","secret","scroll","sword","transformation","truth","virus","weapon"] FIRST_NAME = ["Ace","Adam","Bertram","Bligh","Cal","Deke","Dex","Dean","Dirk","Egan","Hal","Hector","Jack","Jeff","Keith","Kirk","Kris","Kyle","Lark","Marlowe","Max","Neil","Sam","Simon","Stark","Tex","Tom","Walton","Xavier","Zed"] SEXY_JOB = ["archaeologist","biologist","botanist","bouncer","bounty hunter","casino pit boss","chaplain","chemist","doctor","engineer","epidemiologist","forensics expert","game warden","helicopter pilot","hovercraft mechanic","industrial spy","lawyer","former Marine","marine biologist","paranormal researcher","roboticist","physicist"] ANGST = ["plagued by","haunted by","struggling with","battling","on the run from"] ANGST2 = ["alcholism","grief","his dark and mysterious past","amnesia","a bizarre run of bad luck","troubles with women","financial ruin","old debts being called in","a disturbing dream","a series of too-good-to-be-true coincidences","a dangerous clause of a wealthy relative's will","government scrutiny","a pattern only he can see","a strange visitor"] COOLSTUFF = ["adventure","the chance of a lifetime","disaster","a gang of assassins","a threat from Homeland Security","a booby-trapped package","a forgotten enemy","a family curse","a bizarre virus"] GANG_ADJ = ["winter","spring","summer","fall","daylight","darkness","leather","steel","driftwood","machine","Gaia","fate","timeline","mystic","Malta","Atlantis","Bermuda","Pompeii","Gremlin","Spirit","Mephisto","Da Vinci","Lucifer","Luther","Von Braun","Miyamoto","Kitsune","Coyote","Empire"] GANG = ["brotherhood","gang","crew","cabal","agency","team","squad","tribe","union"] REVEAL = ["reveal","unveil","uncover","discover","unlock","seize","publicize"] COOL_PLACE = ["a Mayan temple","a Turkish bazaar","the steam tunnels of MIT","the London Underground","the Black Forest","Russia's Baikonur Kosmodrome","a private spaceport","Chepstow Castle in Wales","cyberspace","the Great Wall of China","the slums of Paris","a lonely diner in Nebraska","Roswell, New Mexico","Pennsylvania's Amish country","a seemingly nondescript Iowa farm","the Australian outback","a convention for animal fanatics","the Canadian Rockies","an obscure Civil War battlefield","a disused oil rig","a terrorist training camp","a zoo in upstate New York","Kyoto's sacred Inari Shrine","a black hole research center"] AWESOME_PLACE = ["the galaxy's edge","the gateway to Hell","Area 51","an alien ruin","a top-secret government base","a castle in the sky","a secret space station powered by Earth","an underwater city drawing energy from the sea","the core of the Net's rising consciousness","a bio-lab holding both promise and peril through manipulating life","the world of dreams"] THE_GRAIL = ["the journey within","the final key","the true danger","the one who knows the truth","the ultimate power","the last piece of the puzzle","the answer they seek","the end of their quest","the light at the end of the tunnel","the prize for victory","the end of their search","their greatest ally"] THE_DANGER = ["most dangerous of all","a threat to all life on Earth","the end of our hero's sanity","the beginning of the end for humanity","a cause for war","the last anyone will see of them"] TITLE_ADJ = [] for n in AMAZING: TITLE_ADJ.append(n.title()) for n in GANG_ADJ: TITLE_ADJ.append(n.title()) TITLE_NOUN = [] for n in SECRET: TITLE_NOUN.append(n.title()) from random import randint def R(what): return what[ randint(0,len(what)-1) ] def Text(what,uppercase=False): if what[0] in "aeiou": t = "an "+what else: t = "a "+what if uppercase: return t[0].upper()+t[1:] else: return t HERO = R(FIRST_NAME) text = "
\n" text += "Novel Blurb Generator" text += "


\n\n" text += "

--- The "+R(TITLE_ADJ)+" "+R(TITLE_NOUN)+" ---

\n" text += Text( R(AMAZING), True )+" "+R(SECRET)+". " text += Text( R(AMAZING), True )+" "+R(SECRET)+". " text += HERO+", "+Text(R(SEXY_JOB))+", finds himself "+R(ANGST)+" "+R(ANGST2)+" when "+R(COOLSTUFF)+" strikes. " text += "Now "+HERO+" must join forces with the "+R(AMAZING)+" "+R(GANG_ADJ).title()+" "+R(GANG).title()+" to "+R(REVEAL)+" the "+R(SECRET)+". " text += "The journey takes them from "+R(COOL_PLACE)+" to "+R(COOL_PLACE)+" and finally to "+R(AWESOME_PLACE)+" itself. " text += "But "+R(THE_GRAIL)+" may prove to be "+R(THE_DANGER)+"..." MakeWebPage( text, title="Novel Blurb Generator", bgcolor="#FFFFFF", text="#000000" )