mirror of
https://github.com/nikdoof/flexget-plugins.git
synced 2025-12-18 04:09:24 +00:00
Fixed formatting again
This commit is contained in:
@@ -32,13 +32,13 @@ class OutputTwitter:
|
||||
twitter.accept('text', key='to')
|
||||
twitter.accept('text', key='username', required=True)
|
||||
twitter.accept('text', key='password', required=True)
|
||||
twitter.accept('text', key='apiurl')
|
||||
twitter.accept('text', key='apiurl')
|
||||
return twitter
|
||||
|
||||
def get_config(self, feed):
|
||||
config = feed.config['twitter']
|
||||
config.setdefault('active', True)
|
||||
config.setdefault('apiurl', 'http://twitter.com/')
|
||||
config.setdefault('apiurl', 'http://twitter.com/')
|
||||
return config
|
||||
|
||||
def feed_exit(self, feed):
|
||||
@@ -52,21 +52,21 @@ class OutputTwitter:
|
||||
if feed.manager.options.learn:
|
||||
return
|
||||
|
||||
api = twitter.Api(username=config['username'], password=config['password'])
|
||||
api = twitter.Api(username=config['username'], password=config['password'])
|
||||
|
||||
if not api.GetFriends()
|
||||
log.warn("Invalid twitter username or password")
|
||||
return
|
||||
|
||||
if not api.GetFriends()
|
||||
log.warn("Invalid twitter username or password")
|
||||
return
|
||||
|
||||
entries_count = len(feed.accepted)
|
||||
if entries_count == 0:
|
||||
return # don't send empty twits
|
||||
|
||||
for entry in feed.accepted:
|
||||
content = "%s found and queued" % entry['title']
|
||||
if len(content) > 120:
|
||||
return
|
||||
else:
|
||||
api.PostUpdate(content)
|
||||
if len(content) > 120:
|
||||
return
|
||||
else:
|
||||
api.PostUpdate(content)
|
||||
|
||||
register_plugin(OutputTwitter, 'twitter')
|
||||
|
||||
Reference in New Issue
Block a user