Skip to content

Instantly share code, notes, and snippets.

@jmhobbs
Created November 11, 2011 04:18
Show Gist options
  • Save jmhobbs/1357181 to your computer and use it in GitHub Desktop.
Save jmhobbs/1357181 to your computer and use it in GitHub Desktop.
A Hubot script to say facts about, uh, anyone.
#
# Hubot Script!
# Random fact about someone else.
#
# Example
#
# Hubot: fact me John Hobbs
# Hubot: John Hobbs counted to infinity - twice.
#
# John Hobbs 2011 - Licensed under MIT
#
facts = [
"#NAME#' tears cure cancer. Too bad he has never cried.",
"#NAME# counted to infinity - twice.",
"#NAME# does not hunt because the word hunting infers the probability of failure. #NAME# goes killing.",
"If you can see #NAME#, he can see you. If you can't see #NAME# you may be only seconds away from death.",
"When the Boogeyman goes to sleep every night he checks his closet for #NAME#.",
"#NAME# built a time machine and went back in time to stop the JFK assassination. As Oswald shot, #NAME# met all three bullets with his beard, deflecting them. JFK's head exploded out of sheer amazement.",
"#NAME# has already been to Mars; that's why there are no signs of life there.",
"There is no chin behind #NAME#' beard. There is only another fist.",
"In fine print on the last page of the Guinness Book of World Records it notes that all world records are held by #NAME#, and those listed in the book are simply the closest anyone else has ever gotten. ",
"The chief export of #NAME# is pain. ",
"#NAME# is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. ",
"The Great Wall of China was originally created to keep #NAME# out. It failed miserably.",
"If you want a list of #NAME#’ enemies, just check the extinct species list. ",
"#NAME# has never blinked in his entire life. Never. ",
"#NAME# doesn’t need to swallow when eating food.",
"If Superman and The Flash were to race to the edge of space you know who would win? #NAME#.",
"#NAME# invented water."
]
module.exports = (robot) ->
robot.respond /fact( me)? (.+)/i, (msg) ->
index = Math.floor Math.random() * facts.length
msg.send facts[index].replace '#NAME#', msg.match[2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment