PERL script for generating random Beatnik poetry (aka my first program ever)
Perl
Latest commit eafacd2 Jul 25, 2012 @flimshaw Update README.md
Permalink
Failed to load latest commit information.
README.md
adjective
adverb
article
bbv2
bbv201
bbv202
bbv203
bbv204
bbv205
bbv206
bbv207
bbv208.perl
bbv208.pl
beatme
being
conjunction
index-web.cgi
index.cgi
index.cgi.bak
index.cgi.bak2
index.cgi.bak3
index.perl
kerouacs_reefer
nouns.people
nouns.places
nouns.things
preposition
pronoun
pronoun.obj
pronoun.pos
verbs.intrans
verbs.trans

README.md

beatnik

DISCLAIMER: There are some questionable code comments in here, but I was 20 years old at the time, so there's that.

Beatnik Box script for generating random Beatnik poetry. I made this for an experimental video project back in 2003, when I was like 20 years old. It was pretty much the first program I ever wrote. In the end, the device that used it looked sort of like a 386 threw up in a fishtank. See here: http://www.flickr.com/photos/mrquint15/550240120/

usage

This script requires PERL. Download the zip file and run:

perl bbv208.pl

This will start the poetry generator, and it will print a poem out one character at a time to the terminal.

how does it work?

The Beatnik script is pretty damn simple. It has a few dictionaries grouped by part of speech, all in text files in this case since I didn't know what a database was at the time, probably. So to generate a poem it:

  1. Generates a random length (in words) for each line, and a line count
  2. Generates a sentence by placing a random part of speech tag for the first word, then adding a part of speech that can follow it, and so on until the end of the sentence.
  3. Loops through and places a random word for each part of speech tag that makes up the sentence
  4. Prints out the poem

why are the poems actually kinda good?

Turns out, if you write poems using the same words Allen Ginsberg used to write Howl, along with some other words from The Lovesong of J. Alfred Prufrock, even a computer can sometimes write something pretty good.

You can try the poetry machine out at my website. A new poem is generated each time you refresh:

=> http://flimshaw.net/beatnik/

do you save the poems anywhere?

Nope. Isn't that sad? They all just go away, unless you save them. I do have a tumblr that generates a new one each day. You can follow it here:

=> http://beatnikbox.tumblr.com/

more questions!

Send an email to charlie.hoey@gmail.com and I'll answer all questions.