Oh poetry ....
... hardiths ocessed giddidartney!
Err ... well ... sort of ... -- What started out as "yet another password generator" (I wanted some device to produce random yet pronounceable passwords) turned into a "poetry machine" pretty quickly.
"Now how's it working?" -- "Quite well, thank you".
No, honestly, it's a pretty trivial principle: I grabbed some plain text files (Parzival, Tannhäuser and Lohengrin for the german poems -- Robinson Crusoe, Fanny Hill *gg* and Mansfield Park for the english poems), took the first and last syllables from every word, dropped those that were too short or duplicate, sorted and stored them.
When it comes down to generating the poems, the engine just takes random syllables and assembles them. The "regular" poem is some sort of "limerick" style ("aabba"), though most of the lack the final punch line :-)
For the "sonnets" I stored the seven schemes that I knew of and made httpoetry match the lines last syllables (more or less). Most of what httpoetry spits out doesn't sound too convinving and the rhythm is far from being correct -- but go check out yourself!
Disclaimer: You may recite as many poems at your local intellectual society's reading as you want, though there's no guarantee that this will make you sexually attractive or help to pick up someone of the same and/or opposite sex. On the other hand they might put you in a loony bin or award you the pulitzer price for poetry. Your mileage may vary depending on your local conventions.