Weird Internets is a series in which we spotlight and explore funny, bizarre, or otherwise interesting corners of the internet. Today, we examine Pentametron, a Twitter bot that writes sonnets by finding rhyming Tweets in iambic pentameter, and talk to its creator, Ranjit Bhatnagar.

For a service that's mostly used to demand things of brands and celebrities, there's a fair amount of poetry on Twitter. The New York Times claimed last year that "there's evidence that the literary flowering of Twitter may actually be taking place." Writing a poem in 140 characters, linguist Ben Zimmer told the paper, comes from the same "impulse that goes into writing a sonnet, of accepting those kind of limits."

Twitter is an inherently silly and disposable means of communication. Oh, but there are people out…
Read more Read more

Ther are, in fact, sonnets being written on Twitter right now. It's just that the people writing them don't realize it. My current favorite Twitter poetry comes from a bot called Pentametron, which lives in Los Angeles, on a cheap server rented by its creator and patron Ranjit Bhatnagar.

Here's a sampling:

1. I'm going swimming after school #hooray2. I wanna hear a special song today :) !3. Last project presentation of the year!!!!4. Miami Sunset Drive／A. normal clear :)

Pentametron uses an algorithm to find and retweet rhyming couplets in iambic pentameter — the ten-syllable alternating-stress meter used in Shakespeare's plays and sonnets — and publish them in 14-line sonnets on Pentametron.com. Like most found poetry, Pentametron's sonnets are semi-sensical, often funny, and sometimes profound, but I admire them even more as a response to the obscene amount of textual noise on the internet. If you're trying to impose some degree of structure to the billions of words circulating throughout Twitter, why not start by enforcing an arbitrary and rigorous literary form dating to 13th century Italy?

It's also fast. "Twitter will cut me off if my program falls too far behind," Bhatnagar says, so Pentametron, like any good poet, "tries to work as fast as possible by not thinking too hard."

First, it strips the tweet of emoticons and ASCII art. It then cross-references each word against the CMU Pronouncing Dictionary. CMU includes stress markers, indicated, in a poetically neat turn, as ones and zeros — the line for abandonment, for example, is "AH0 B AE1 N D AH0 N M AH0 N T" — and Pentametron compares those markers against the binary line for iambic pentameter: 0101010101. If the tweet is in iambic pentameter, Pentametron retweets it; if not, it moves on.

At the start, Pentametron concerned itself only with rhythm, which made for engaging if opaque blank-verse sonnets. It now attempts to create rhyming couplets, in chronological order. (Bhatnagar acknowledges that the AABB rhyme scheme of Pentametron's sonnets isn't properly Shakespearean, and says he plans on eventually reworking his robo-poet to write in more complex rhyme schemes.) To find its couplets, Pentametron stores each iambic tweet it finds in a memory buffer. Every new iambic tweet that comes on — this happens "about every minute or two" — is compared to the tweets in the buffer. When a rhyme is found, the couplet is retweeted. "I think pentametron looks at about a million tweets for each rhymed couplet it finds," Bhatnagar says, "and yet it finds them, reliably, just because millions of people are talking about millions of things."

Many of those millions of people are talking about the same thing, in the exact same words. Bhatnagar was forced to create a "blacklist of Twitter clichés" — tweets in iambic pentameter that show up too often, like "I wanna see the hunger games again." And there's the problem of Twitter spam accounts that pull random text from public-domain sources. "Just in the last few days, there's been a big uptick in spam using texts from actual sonnets and plays in pentameter," Bhatnagar says. "Pentametron can't resist them."

When a sonnet is completed, it's published on Pentametron.com, where you can browse through a regularly-updated group of 14 poems. Bhatnagar checks in a few times a day to delete really egregious errors. He doesn't have a particular favorite poem. "I always find some new funny or accidentally profound thing there to enjoy," he says. "It's fascinating to me that on the internet of free phone and video calls, one of the most popular sites just moves words around. Lots and lots of words. One of the goals of Pentametron is to show how weird and interesting this giant flood of language is."

Vital Stats

INTERNETTING SINCE: Bhatnagar's been on the internet since "the dark ages." Pentametron has been writing sonnets for about a month now.