Talk Notes - Ranjit Bhatnagar - Pentametron - A Twitter Bot In Iambic Pentameter
Ranjit
Freelance Artist for 8 years
Worked for Gamelab for 8 yrs - online games
Newspapers & Online Pubs. back when Web was New
Master in Comp. Sci
Pentametron
twitter.com/pentametron
Ranjit Bhatnagar
http://moonmilk.com
1995 - Used Usenet to write Collaborative Sonnets
Pentametron == Sonnet Writing Machine - derived from that
Subscribes to some API (Twitter Garden Hose Stream) that feeds it 525 million tweets a day
325 MB PHP program running on a server
It checks every word against its vocab
Dumps 97%
Then Checks if they're in Iambic Pentameter
Then Checks if they rhyme & retweets the pairs
Retweets can disappear if user deletes the original
Twitter:
Streaming APIs - dev.twitter.com/streaming
Sign up for Free
Sample = 1% in the world
CMU Pronouncing Dictionary:
speech.cs.cmu/........
Simple Database
200,000 Words
English & Other Proper Names & some Spanish/French
Gives you Pronunciation for any word
Has about 50 phones for sound
Each vowel tagged with numbers, for Stress/Non-Stress
Iambic Pentameter:
10 Syllables where every second syllable is stressed
CMU checks the Stress Structure of each word, based on the number-tagged-vowels
If Flag == 2, then you can use it
If first Word is Single Syllable, it gets evaluated as 0
To Figure Out Rhyming:
Two things rhyme if all the sounds after the last stressed syllable
Secondary Stresses (2) are counted as 0s
Saves Distinguishing Consonant so word doesn't get matched with another copy of itself
Had to figure out how to Catch Emoji so that they wouldn't be looked up
Library to interact w/ Twitter API
Phirehose - written in PHP
So Pentametron is written in PHP too
Looks like a terrible mess, but super fast
His Minimal Server couldn't handle Node
"If it works, it's really hard to get around to fixing it"
Qeues 500 times/s
Bloated JSON - Sends about 4k per tweet
Has Text & Tweet ID & Attribute (amongst other things)
php Object - Pentameter
Also has Blacklist for words that are too common or boring or when someone complains
Syllable Structure is in Strings in Code instead of in an Array 0.0
Server apparently has more process time than memory
Has a mini-blacklist to not repeat previous rhyme endings
Timeout:
Any tweet that's 4 hrs old is thrown out
Pentametron Fanart
20,600 followers
Music Written
SLASH FICTION - ARCHIVE OF OUR OWN
Stupidcounter only counts
Pentametron ocassionaly retweets theese
Ember Nickel writes slash for @pentametron & @stupidcounter
Q: Total Buffer Number?
A: No Fixed Number
Filter Potentially Sensitive Content?
Probably & I haven't thought about it & I probably should. I'm reluctant to filter it, but I should probly put more thought into that
Question: Are you storing them?
Answer: Originally it just dumped them into a Log File. Now it dumps it into a smaller log file, and also the larger file
Question: Did you make the Emoticon Blacklist on your own?
Answer: It's two lines of code
Question: How did the slash fiction come to your attention?
Answer: The Author tweeted at you
Question: Who owns the tweets. Can you make a book with them?
Answer: That's something I don't want to think about too hard. I've had an art installation in Boston that used tweets I've published in PDF form only
Originally inspired by NaNoWriMo
Now someone made NaNoGenMo - Generate a Novel within a Month
Question: How does writing a Bot change your take on Art
Answer: Before this project I was into weird collaborative language projects ... Uri Po [Transcriber Note: This is in French - I got it wrong]
There's potential in new ways of making literature & art
Moth Generator - Algorithmic Moth Generator
Question: How do you get to make Art Installations:
Answer: Filling out Lots of tedious applications & web searches
Followup: Maybe a Script could do that for you
Followup Answer: I also get things through Friend Connections
Question: Is Art legit? or is it a waste of time
Answer: *Shrugs Emoji*