Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tomviner/Spam_Py_Mamma
Browse files Browse the repository at this point in the history
  • Loading branch information
tomviner committed Mar 1, 2012
2 parents e83fb50 + d3669e8 commit 5d90567
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
7 changes: 3 additions & 4 deletions replier.py
Expand Up @@ -21,7 +21,6 @@ class Replier(object):
'beer': replies['mum'],
}

@hashtag
def analyse_tweet(self, tweet):
roman_result = attempt_roman(tweet)
if roman_result:
Expand All @@ -33,6 +32,6 @@ def analyse_tweet(self, tweet):
return "Spammama doesn't know"

replier = Replier()
print replier.analyse_tweet('test', 'I got hammered today');
print replier.analyse_tweet('gump', 'Fancy a meal somwhere?');
print replier.analyse_tweet('Anthony', 'MMCXL');
print replier.analyse_tweet('I got hammered today');
print replier.analyse_tweet('Fancy a meal somwhere?');
print replier.analyse_tweet('MMCXL');
13 changes: 10 additions & 3 deletions tweet.py
Expand Up @@ -35,16 +35,23 @@ def tweet(self,text):
def mentions(self):
m = self.api.mentions()

texts = [ n.text for n in m ]
#texts = [ n.text for n in m ]
texts = [ n.user.screen_name for n in m ]


replies = [ '@' + n.user.screen_name + ': ' + self.replier.analyse_tweet(n.text) + ' #ldnpydojo' for n in m ]

for reply in replies:
self.tweet(reply)
try:
self.tweet(reply)
except tweepy.TweepError:
pass

def search(self):
m = self.api.search('#ldnpydojo')

#replies = [ '@' + n.user.screen_name + ': ' + self.replier.analyse_tweet(n.text) + ' #ldnpydojo' for n in m ]

return m

# search for 'hammer'
# respond to roman numerals
Expand Down

0 comments on commit 5d90567

Please sign in to comment.