Skip to content

Instantly share code, notes, and snippets.

@matthewsimo
Created November 29, 2012 19:18
Show Gist options
  • Select an option

  • Save matthewsimo/4171215 to your computer and use it in GitHub Desktop.

Select an option

Save matthewsimo/4171215 to your computer and use it in GitHub Desktop.
Insults script for hubot
# Allow Hubot to give a burn Shakespeare would approve of.
#
# Commands:
# insult <name> - Don't have a good comeback, ask for some backup.(name parameter optional)
data = [["artless","bawdy","beslubbering","bootless","churlish","cockered","clouted","craven","currish","dankish","dissembling","droning","errant","fawning","fobbing","froward","frothy","gleeking","goatish","gorbellied","impertinent","infectious","jarring","loggerheaded","lumpish","mammering","mangled","mewling","paunchy","pribbling","puking","puny","qualling","rank","reeky","roguish","ruttish","saucy","spleeny","spongy","surly","tottering","unmuzzled","vain","venomed","villainous","warped","wayward","weedy","yeasty","cullionly","fusty","caluminous","wimpled","burly-boned","misbegotten","odiferous","poisonous","fishified"],["tardy-gaited","rampallian","beef-witted","dizzy-eyed","fool-born","scurvy-valiant","brazen-faced","muddy-mettled","beetle-headed","boil-brained","clapper-clawed","folly-fallen","base-court","full-gorged","flap-mouthed","motley-minded","clay-brained","spur-galled","Basket-Cockle","half-faced","hedge-born","ill-nurtured","shard-borne","sheep-biting","whoreson","unwash'd","bunch-back'd","leaden-footed","crook-pated","dismal-dreaming","doghearted","earth-vexing","elf-skinned","fat-kidneyed","fly-bitten","guts-griping","hasty-witted","hell-hated","idle-headed","ill-breeding","pottle-deep","pox-marked","rough-hewn","swag-bellied","toad-spotted","lily-livered","common-kissing","dread-bolted","fen-sucked","knotty-pated","rude-growing","tickle-brained","weather-bitten","bat-fowling","plume-plucked","reeling-ripe","rump-fed","unchin-snouted","malmsey-nosed","Wart-necked"],["apple-john","baggage","barnacle","bladder","boar-pig","bugbear","bum-bailey","canker-blossom","clack-dish","clotpole","coxcomb","codpiece","death-token","dewberry","flap-dragon","flax-wench","flirt-gill","fustilarian","foot-licker","giglet","gudgeon","haggard","harpy","hedge-pig","joithead","lewdster","lout","maggot-pie","horn-beast","hugger-mugger","mammet","malt-worm","measle","pignut","miscreant","moldwarp","mumble-news","nut-hook","pigeon-egg","pumpion","ratsbane","skainsmate","strumpet","varlot","vassal","whey-face","wagtail","knave","popinjay","blind-worm","scullian","malcontent","devil-monk","toad","rascal","jolt-head"]]
randomItem = (x) ->
data[x][Math.floor((Math.random() * data[x].length)+1)]
calculateInsult = (person) ->
person = person || ""
i0 = randomItem(0)
i1 = randomItem(1)
i2 = randomItem(2)
"#{person}, thou art a #{i0} #{i1} #{i2}."
module.exports = (robot) ->
robot.respond /(insult)(\s*)?(.*)?/i, (msg) ->
person = msg.match[3] || msg.message.user.name
msg.send calculateInsult(person)
@matthewsimo

Copy link
Copy Markdown
Author

Oops! Linked Brian's twitter handle, he's @inspectorfegter on github, fyi!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment