Skip to content

Instantly share code, notes, and snippets.

@ambar
Created January 12, 2012 16:01
Show Gist options
  • Save ambar/1601302 to your computer and use it in GitHub Desktop.
Save ambar/1601302 to your computer and use it in GitHub Desktop.
大爱 Bender. x-futurama middleware for expressjs app
var express = require('express')
var app = express.createServer()
var port = 3000
app.use( require('./x-futurama') )
app.get('*',function(req,res,next) {
res.end()
})
app.listen(port);
console.log('Try this command: curl -I localhost:'+port)
{
"X-Bender": [
"A woman like that you gotta romance first!",
"Ah crap, I'm some sort of robot!",
"Ahhh, functional.",
"Alright! Closure!",
"An upgrade? I thought we all agreed I was perfect.",
"And I bet it's gonna get a lot more confusing.",
"Are you familiar with the old robot saying \"does not compute\"?",
"Aw, this bends!",
"Bender knows when to use finesse.",
"Bender's a genius!",
"Bite my shiny, metal ass!",
"Boy, were we suckers!",
"Boy, who knew a cooler could also make a handy wang coffin?",
"But-- those girls don't wear cases! You can see their bare circuits!",
"Care to contribute to the Anti-Mugging-You Fund?",
"Comedy's a dead art form. Now tragedy -- THAT'S funny.",
"Crippling pain? That's not covered by my insurance fraud.",
"Curse my natural showmanship!",
"Curse you, merciful Poseidon!",
"Down with Bender!",
"Emotions are dumb and should be hated.",
"Farewell, big blue ball of idiots!",
"Fathero!",
"Float like a floatbox, sting like an automatic stingin' machine.",
"Fry, of all the friends I've had ... you're the first.",
"Gimme your biggest, strongest, cheapest drink.",
"Hey Fry, I'm steering with my ass!",
"Hooray, we don't have to do anything!",
"I am a hideous triumph of form and function.",
"I choose to not understand these signs!",
"I hate people who love me. And they hate me.",
"I only know enough binary to ask where the bathroom is.",
"I only speak enough binary to ask where the bathroom is.",
"I'm a fraud. A poor, lazy, sexy fraud.",
"I'm an outdated piece of junk.",
"I'm not allowed to sing. Court order.",
"I'm one of those lazy, homeless bums I've been hearing about.",
"I'm so embarrassed. I wish everybody else was dead.",
"I'm tired of this room and everyone in it!",
"I've gone too far! Who does that guy think I am?",
"In the event of an emergency, my ass can be used as a flotation device.",
"Let's commence preparations for rumbling!",
"Lick my frozen, metal ass!",
"Life is hilariously cruel.",
"Like most of life's problems, this one can be solved with bending.",
"Listen up, cause I got a climactic speech.",
"My full name is Bender Bending Rodriguez.",
"My life, and by extension everyone else's, is meaningless.",
"Nothing like a warm fire and a super-soaker of fine cognac.",
"Now that's hospital dancing.",
"OK, but I don't want anyone thinking we're robosexuals.",
"Oh no! Not the magnet!",
"Oh, so, just 'cause a robot wants to kill humans that makes him a radical?",
"Professor! Make a woman out of me!",
"Senseless death! The folk singer's best friend!",
"Shooting DNA at each other to make babies. I find it offensive!",
"Since I love you all so much, I'd like to give everyone hugs.",
"Stop doing the right thing, you jerk!",
"Stupid anti-pimping laws!",
"That's not my gold-plated 25-pin connector.",
"The laws of science be a harsh mistress.",
"The modern world can bite my splintery, wooden ass!",
"The sparks keep me warm.",
"There! That oughtta convert a few tailgaters.",
"They're tormenting me with uptempo singing and dancing!",
"This guy's not making any sense. Can I kill him? Please?",
"Try this, kids at home!",
"Wait! My cheating unit malfunctioned! You gotta give me a do-over!",
"Want me to smack the corpse around a little?",
"We're both expressible as the sum of two cubes!",
"Well I don't have anything else planned for today, let's get drunk!",
"Whaddya say, folks? Hot or not?",
"When will man learn that all races are equally inferior to robots?",
"Whoever's directing this is a master of suspense!",
"Why would God think in binary?",
"Woohoo, I'm popular!",
"Would we have donkeys?",
"Yes! I got the most! I win X-Mas!",
"You can trust anything!",
"You can't count on God for jack! He pretty much told me so himself.",
"You just lost five dollars.",
"nogoodlawsprotectingtheinnocent--"
],
"X-Fry": [
"But this is HDTV. It's got better resolution than the real world.",
"Can I pull up my pants now?",
"Existing is basically all I do!",
"Hardy Boys: too easy. Nancy Drew: too hard!",
"Hey look, it's that guy you are!",
"Hooray, we don't have to do anything!",
"How about me? I'm human, and I've always wanted to see the future!",
"How can I live my life if I can't tell good from evil?",
"I can burp the alphabet. A, B, D ... no, wait ...",
"I did it! And it's all thanks to the books at my local library.",
"I don't regret this, but I both rue and lament it.",
"I have more important things to do today than laugh and clap my hands.",
"I haven't had time off since I was twenty-one through twenty-four.",
"I must be a robot. Why else would human women refuse to date me?",
"I refuse to testify on the grounds that my organs will be chopped up into a patty.",
"I'll be whatever I wanna do.",
"I'm going to continue never washing this cheek again.",
"I'm gonna be a science fiction hero, just like Uhura, or Captain Janeway, or Xena!",
"I'm literally angry with rage!",
"I'm never gonna get used to the thirty-first century. Caffeinated bacon?",
"I'm not a robot like you -- I don't like having disks crammed into me. Unless they're Oreos. And then only in the mouth.",
"It's a widely-believed fact!",
"It's all there, in the macaroni.",
"It's like a party in my mouth and everyone's throwing up.",
"Leela, Bender, we're going grave-robbing.",
"Leela, there's nothing wrong with anything.",
"Make up some feelings and tell her you have them.",
"My hands! My horrible, human hands!",
"No, no, I was just picking my nose.",
"People said I was dumb but I proved them!",
"Please, Mr. Nixon! We're appealing to your sense of decency!",
"Prepare to be thought at!",
"Robots don't go to heaven.",
"Stop abducting me!",
"Sweet justice! Sweet, juicy justice!",
"That doesn't look like an \"L\", unless you count lower case.",
"That's a chick show. I prefer programs of the genre: World's Blankiest Blank.",
"The butter in my pocket is melting!",
"The less fortunate get all the breaks!",
"The spoon's in the foot powder.",
"There's a lot about my face you don't know.",
"There's a political debate on. Quick, change the channel!",
"These new hands are great. I'm gonna break them in tonight.",
"They're great! They're like sex except I'm having them.",
"What kind of bozos would start a Bender protest group?",
"Where's Captain Bender? Off catastrophizing some other planet?",
"Why use my own legs like an idiot when I can use a Chickenwalker?",
"You mean Bender is the evil Bender? I'm shocked! Shocked! Well not that shocked.",
"You'll barely regret this."
],
"X-Leela": [
"Do you have idiots on your planet?",
"He opened up relations with China. He doesn't want to hear about your ding-dong.",
"I'm a millionaire! Suddenly I have an opinion about the capital gains tax.",
"My old life wasn't as glamorous as my webpage made it look.",
"No, Leela will show you out.",
"There's a political debate on. Quick, change the channel!",
"This is by a wide margin the least likely thing that has ever happened.",
"This toads the wet sprocket.",
"This wangs chung.",
"You did the best you could, I guess, and some of these gorillas are okay."
]
}
var quotes = JSON.parse( require('fs').readFileSync('quotes.json').toString() )
var list = Object.keys(quotes).reduce(function(ary,key){
return ary.concat(quotes[key].map(function(quote){
return {key:key,quote:quote}
}))
},[])
var random = function() {
return list[ Math.floor( Math.random() * list.length ) ]
}
module.exports = function(req,res,next) {
var q = random()
res.setHeader(q.key,q.quote)
next()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment