Created
November 5, 2012 06:27
-
-
Save arn-e/4015665 to your computer and use it in GitHub Desktop.
shakes
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
require 'twitter' | |
require 'tweetstream' | |
require 'pp' | |
require 'csv' | |
class TwitterResponder | |
def initialize | |
@shakes = CSV.read('shakespeare.csv') | |
Twitter.configure do |config| | |
config.consumer_key = CONSUMER_KEY | |
config.consumer_secret = CONSUMER_SECRET | |
config.oauth_token = OAUTH_TOKEN | |
config.oauth_token_secret = OAUTH_TOKEN_SECRET | |
end | |
TweetStream.configure do |config| | |
config.consumer_key = CONSUMER_KEY | |
config.consumer_secret = CONSUMER_SECRET | |
config.oauth_token = OAUTH_TOKEN | |
config.oauth_token_secret = OAUTH_TOKEN_SECRET | |
config.auth_method = :oauth | |
end | |
listen | |
end | |
def listen | |
TweetStream::Client.new.track('#dbc_c4') do |status| | |
response(status.user[:screen_name]) | |
end | |
end | |
def response(respond_to, response = craft_response) | |
Twitter.update("@#{respond_to} #{response}, \##{response.split(' ')[1]} :)") | |
end | |
def craft_response(phrase = []) | |
(0..2).each {|i| phrase << @shakes[rand([email protected] - 1)][i]} | |
phrase.insert(0,"Thou").join(' ') | |
end | |
end | |
tw_bot = TwitterResponder.new |
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
c1 | c2 | c3 | |
---|---|---|---|
artless | base-court | apple-john | |
bawdy | bat-fowling | baggage | |
beslubbering | beef-witted | barnacle | |
bootless | beetle-headed | bladder | |
churlish | boil-brained | boar-pig | |
cockered | clapper-clawed | bugbear | |
clouted | clay-brained | bum-bailey | |
craven | common-kissing | canker-blossom | |
currish | crook-pated | clack-dish | |
dankish | dismal-dreaming | clotpole | |
dissembling | dizzy-eyed | coxcomb | |
droning | doghearted | codpiece | |
errant | dread-bolted | death-token | |
fawning | earth-vexing | dewberry | |
fobbing | elf-skinned | flap-dragon | |
froward | fat-kidneyed | flax-wench | |
frothy | fen-sucked | flirt-gill | |
gleeking | flap-mouthed | foot-licker | |
goatish | fly-bitten | fustilarian | |
gorbellied | folly-fallen | giglet | |
impertinent | fool-born | gudgeon | |
infectious | full-gorged | haggard | |
jarring | guts-griping | harpy | |
loggerheaded | half-faced | hedge-pig | |
lumpish | hasty-witted | horn-beast | |
mammering | hedge-born | hugger-mugger | |
mangled | hell-hated | joithead | |
mewling | idle-headed | lewdster | |
paunchy | ill-breeding | lout | |
pribbling | ill-nurtured | maggot-pie | |
puking | knotty-pated | malt-worm | |
puny | milk-livered | mammet | |
qualling | motley-minded | measle | |
rank | onion-eyed | minnow | |
reeky | plume-plucked | miscreant | |
roguish | pottle-deep | moldwarp | |
ruttish | pox-marked | mumble-news | |
saucy | reeling-ripe | nut-hook | |
spleeny | rough-hewn | pigeon-egg | |
spongy | rude-growing | pignut | |
surly | rump-fed | puttock | |
tottering | shard-borne | pumpion | |
unmuzzled | sheep-biting | ratsbane | |
vain | spur-galled | scut | |
venomed | swag-bellied | skainsmate | |
villainous | tardy-gaited | strumpet | |
warped | tickle-brained | varlot | |
wayward | toad-spotted | vassal | |
weedy | unchin-snouted | whey-face | |
yeasty | weather-bitten | wagtail |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment