Twitter mention in notification

This commit is contained in:
Ruud
2011-10-12 15:20:49 +02:00
parent 4e6127b6bc
commit 90f342bd17
2 changed files with 8 additions and 0 deletions
@@ -27,6 +27,10 @@ config = [{
'name': 'access_token_secret',
'advanced': True,
},
{
'name': 'mention',
'description': 'Add a mention to this user to the tweet.',
},
],
}
],
@@ -36,6 +36,10 @@ class Twitter(Notification):
api = Api(self.consumer_key, self.consumer_secret, self.conf('access_token_key'), self.conf('access_token_secret'))
mention = self.conf('mention')
if mention:
message = '%s @%s' % (message, mention.lstrip('@'))
try:
api.PostUpdate('[%s] %s' % (self.default_title, message))
except Exception, e: