Category: Code

Movie Lines bot / 48 lines

Building on the bot-structure I built for the @life_by_desree bot, I built a quick bot that tweets alphabetised movie lines from the Cornell Movie Dialog Corpus, called @al_film_betical.

I started working with this corpus in 2016, with the project Scriptych. Part of the project involved building vector embeddings for words from Hollywood movies; as a side part of the project I started to play with alphabetising movie lines from the films in the Cornell Movie Dialog Corpus. Some of the outcomes were oddly poetic, for example this section beginning with “Oh dear”:

Oh dear God. Its all right...a bad dream, just a nasty old dream.
Oh dear God...
Oh dear God...
Oh dear girl, your extracurricular activities are of no consequence to me. I don't give a damn who you sleep with. I'm concerned about David.
Oh dear! But then where did the motorcyclists come from?
Oh dear! George, this is gonna kill Tony. He's waited his whole life for this break.
Oh dear, I didn't really mean to...
Oh dear, I feel like doing a bit of work.
Oh dear, are you actually laughing?
Oh dear, why is life so complicated? Sometimes I really wish I could be someone else.
Oh dear, yes. You were an excellent student, before all that clarinet nonsense. You loved Chopin. You used to call it "heaven music." "Teach me some heaven music," you used to say.
Oh dear- -you're geting that downtrodden look again-
Oh dear.
Oh dear.
Oh dear.
Oh dear.
Oh dear.
Oh dear. Have I made a blunder?
Oh dear. He wasn't friendly during the filming?
Oh dear. I have made you nervous.
Oh dear. I'll never work in this town again?
Oh dear. If one must have a clinical name.
Oh dear....easy honey...

Or this list of things that people forgot:

You forget what I went through to give ya the best.
You forget where I work?
You forget yourself!
You forget yourself, Homer. This here's my daughter! You got your own mess to deal with--ain't that right?
You forget, I dislike YOU at least as much as him.
You forgetting the gag line, Killaine. The police don't take anything for granted.
You forgetting who sat next to you for a thousand missions. I know how you drive.
You forgot "sexy".
You forgot her degree in literature. She's a writer. She published a novel last year under a pen name. Do you want to know what it's about?
You forgot something.
You forgot something...
You forgot the "Now I'm going to tell you what the hell is going on" step. See usually that comes before the, "It's over" Step. And it always, always comes before the "You can go" Step. What is over?
You forgot the Hula!
You forgot the mangoes, didn't you?
You forgot the milk.
You forgot the tent?
You forgot this.
You forgot to be there.
You forgot to say 'Simon says."
You forgot to tell me what a City Sealer has to do.
You forgot to wash my purple shirt. I told you a hundred times it was Purple Day at school today.
You forgot your keys!

I liked some of the outcomes so much that I took the section which begins with the word ‘Love’ and used it as poem at my own wedding (romantically titled 48 Lines about Love, alphabetically ordered), which was read out loud in inimitable style by my good friend Craig Nunes:

48 Lines about Love, alphabetically ordered

Love a cup of tea. With lemon.
Love and happiness for ever.
Love at first sight?
Love demands it.
Love doesn't have to be right. It just has to be love.
Love gives you wings. It makes you fly. I don't even call it love. I call it Geronimo.
Love him… Yes, it is true. That's the hard part for me… I knew him better than anyone … I knew him best.
Love holds you to me. And we are in danger, not you.
Love is different for different people.
Love is funny.
Love is just another name for sex. Love is sexy and sex is lovely -- I don't care what you call it, an android can't have it.
Love is… love is… love is…
Love it!
Love it.
Love it. Which way?
Love me oodles and oodles?
Love me.
Love me… keep me safe…
Love me?
Love that name.
Love this car! Is it new?
Love to, sir, but no can do. No spare room. Period.
Love to--
Love to.
Love to.
Love was never our problem.
Love ya, Margie.
Love ya.
Love you too.
Love you too..
Love you! …Well, why don't we turn in?
Love you, Dil.
Love you, man.
Love you, too.
Love! You don't love anybody! Me or anybody else! You want to be loved - that's all you want!
Love! I'm made of love!
Love! What do you know about love?
Love's a killer, isn't it?
Love's the same as it always was. It's people who change.
Love, Sire!
Love, secret, and uh, sex. But not in that order, necessarily, right?
Love, you can still write to each other.
Love.
Love.
Love.
Love.
Love.
Love. Passion. Obsession, all those things you told me to wait for. Well, they've arrived.

Anyway, Movielinesbot is quite simple – it takes the 304446 lines of alphabetised movie lines and tweets them one at a time. At the time of writing, it’s currently up to the “His name is…” section.

All of the code is on Github – see the Movielinesbot and the original 48 lines repositories if you want to play with this code. The bot is @al_film_betical. Credits to the Cornell Movie Dialogs Corpus, which is a great resource. 🙂

NaNoGenMo 2019: Directory Directory

I decided to participate in NaNoGenMo (National Novel Generation Month) this year with a project called Directory Directory – an online directory of fictional companies, all located within the Alphaville-Zulutown region. It’s organised like an old phone book, by service type, and each company has a name, slogan, address, and phone number.

Some day in the future I’ll update the directory to have more information, and use more advanced grammar, and maybe even be printable. But the project was a nice excuse to learn some new things (the Tracery library for python is fun to play with; it’s also the first time I’ve built a workflow to build a whole generative website).

Some services
Companies offering Anemic Sling services

You can see the project at directory.olliepalmer.com, and play with the code that wrote it at GitHub. Enjoy!

Des’ree Bot

This week, I made a silly Twitter bot. It was mostly an attempt to make a tutorial about making Twitter bots using Dreamhost servers, but ended up being a bot who periodically tweets lines from Des’ree’s 1998 hit Life.

The bot itself is inspired by the africa by totobot, which simply tweets a random line from the song every few minutes. It is actually so irritating that I’ve stopped following it myself, as I found my days permeated by twee earworms about preferring toast to ghosts, or the desire to fly around the world in a beautiful balloon. 

The codebase is on Github – you can use it to build bots yourself if you use Dreamhost, or adapt the code slightly if you use another host (or have your own server). 

You can also follow the bot at @life_by_desree, if you dare.