Last active
July 13, 2016 15:43
-
-
Save mattcoll147/1f735f3d3d77b2f053fb0df0f2737aed to your computer and use it in GitHub Desktop.
Using twitter Api and quandyfactory/insult.py to send an elizabethen insult via twitter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import twitter | |
api = twitter.Api(consumer_key='', | |
consumer_secret='', | |
access_token_key='', | |
access_token_secret='') | |
api.PostUpdate(generate_insult() + ' sent via my python insult generator! #TechInsults') | |
def generate_insult(): | |
""" | |
Generates an Elizabethan insult. | |
Insult terms are via: http://www.museangel.net/insult.html#generator | |
Get insulted on the web at: http://quandyfactory.com/insult | |
Update: Duh! The Elizabethan second person singular pronoun is "thou", not "you" | |
""" | |
from random import randint | |
words = ( | |
('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', 'Quailing', 'Rank', 'Reeky', 'Roguish', 'Ruttish', 'Saucy', 'Spleeny', 'Spongy', 'Surly', 'Tottering', 'Unmuzzled', 'Vain', 'Venomed', 'Villainous', 'Warped', 'Wayward', 'Weedy', 'Yeasty',), | |
('Base-court', 'Bat-fowling', 'Beef-witted', 'Beetle-headed', 'Boil-brained', 'Clapper-clawed', 'Clay-brained', 'Common-kissing', 'Crook-pated', 'Dismal-dreaming', 'Dizzy-eyed', 'Dog-hearted', 'Dread-bolted', 'Earth-vexing', 'Elf-skinned', 'Fat-kidneyed', 'Fen-sucked', 'Flap-mouthed', 'Fly-bitten', 'Folly-fallen', 'Fool-born', 'Full-gorged', 'Guts-griping', 'Half-faced', 'Hasty-witted', 'Hedge-born', 'Hell-hated', 'Idle-headed', 'Ill-breeding', 'Ill-nurtured', 'Knotty-pated', 'Milk-livered', 'Motley-minded', 'Onion-eyed', 'Plume-plucked', 'Pottle-deep', 'Pox-marked', 'Reeling-ripe', 'Rough-hewn','Rude-growing', 'Rump-fed', 'Shard-borne', 'Sheep-biting', 'Spur-galled', 'Swag-bellied', 'Tardy-gaited', 'Tickle-brained', 'Toad-spotted', 'Unchin-snouted', 'Weather-bitten',), | |
('Apple-john', 'Baggage', 'Barnacle', 'Bladder', 'Boar-pig', 'Bugbear', 'Bum-bailey', 'Canker-blossom', 'Clack-dish', 'Clot-pole', 'Coxcomb', 'Codpiece', 'Death-token', 'Dewberry', 'Flap-dragon', 'Flax-wench', 'Flirt-gill', 'Foot-licker', 'Fustilarian', 'Giglet', 'Gudgeon', 'Haggard', 'Harpy', 'Hedge-pig', 'Horn-beast', 'Huggermugger', 'Jolt-head', 'Lewdster', 'Lout', 'Maggot-pie', 'Malt-worm', 'Mammet', 'Measle', 'Minnow','Miscreant', 'Mold-warp', 'Mumble-news', 'Nut-hook', 'Pigeon-egg', 'Pignut', 'Puttock','Pumpion', 'Rats-bane', 'Scut', 'Skains-mate', 'Strumpet', 'Varlot', 'Vassal', 'Whey-face', 'Wagtail',), | |
) | |
insult_list = ( | |
words[0][randint(0,len(words[0])-1)], | |
words[1][randint(0,len(words[1])-1)], | |
words[2][randint(0,len(words[2])-1)], | |
) | |
vowels = 'AEIOU' | |
article = 'an' if insult_list[0][0] in vowels else 'a' | |
return 'Thou art %s %s, %s %s.' % (article, insult_list[0], insult_list[1], insult_list[2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment