Revert "Feature #3967 - Added IMDB link to download complete tweet"
This reverts commit 87338760ad.
This commit is contained in:
@@ -34,13 +34,11 @@ class Twitter(Notification):
|
|||||||
|
|
||||||
def notify(self, message = '', data = None, listener = None):
|
def notify(self, message = '', data = None, listener = None):
|
||||||
if not data: data = {}
|
if not data: data = {}
|
||||||
log.debug('Data in notification is %s', data['identifier'])
|
|
||||||
api = Api(self.consumer_key, self.consumer_secret, self.conf('access_token_key'), self.conf('access_token_secret'))
|
api = Api(self.consumer_key, self.consumer_secret, self.conf('access_token_key'), self.conf('access_token_secret'))
|
||||||
|
|
||||||
direct_message = self.conf('direct_message')
|
direct_message = self.conf('direct_message')
|
||||||
direct_message_users = self.conf('screen_name')
|
direct_message_users = self.conf('screen_name')
|
||||||
|
|
||||||
message = '%s%s' % (message,' - http://www.imdb.com/title/' + data['identifier'] if data['identifier'] else '')
|
|
||||||
|
|
||||||
mention = self.conf('mention')
|
mention = self.conf('mention')
|
||||||
mention_tag = None
|
mention_tag = None
|
||||||
@@ -61,20 +59,11 @@ class Twitter(Notification):
|
|||||||
update_message = '[%s] %s' % (self.default_title, message)
|
update_message = '[%s] %s' % (self.default_title, message)
|
||||||
if len(update_message) > 140:
|
if len(update_message) > 140:
|
||||||
if mention_tag:
|
if mention_tag:
|
||||||
if update_message.find(" - http://www.imdb.com/title/") < 141 and update_message.find(" - http://www.imdb.com/title/") > 0:
|
api.PostUpdate(update_message[:135 - len(mention_tag)] + ('%s 1/2 ' % mention_tag))
|
||||||
api.PostUpdate(update_message[:update_message.find(" - http://www.imdb.com/title/") - len(mention_tag)] + ('%s 1/2 ' % mention_tag))
|
api.PostUpdate(update_message[135 - len(mention_tag):] + ('%s 2/2 ' % mention_tag))
|
||||||
api.PostUpdate(update_message[update_message.find(" - http://www.imdb.com/title/") - len(mention_tag):] + ('%s 2/2 ' % mention_tag))
|
|
||||||
else:
|
|
||||||
api.PostUpdate(update_message[:135 - len(mention_tag)] + ('%s 1/2 ' % mention_tag))
|
|
||||||
api.PostUpdate(update_message[135 - len(mention_tag):] + ('%s 2/2 ' % mention_tag))
|
|
||||||
else:
|
else:
|
||||||
if update_message.find(" - http://www.imdb.com/title/") < 141 and update_message.find(" - http://www.imdb.com/title/") > 0:
|
api.PostUpdate(update_message[:135] + ' 1/2')
|
||||||
api.PostUpdate(update_message[:update_message.find(" - http://www.imdb.com/title/")] + ' 1/2')
|
api.PostUpdate(update_message[135:] + ' 2/2')
|
||||||
api.PostUpdate(update_message[update_message.find(" - http://www.imdb.com/title/"):] + ' 2/2')
|
|
||||||
else:
|
|
||||||
api.PostUpdate(update_message[:135] + ' 1/2')
|
|
||||||
api.PostUpdate(update_message[135:] + ' 2/2')
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
api.PostUpdate(update_message)
|
api.PostUpdate(update_message)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user