logo

scripts

A bunch of scripts, some to be moved to their own repository
commit: 3dc676ed261a6d3f4e0bcb65c43189ec2a63b52f
parent: f9d63b9cd852a948079cde01f57cd071d88061cb
Author: lanodan <lanodan.delta@free.fr>
Date:   Sat,  7 Feb 2015 21:03:04 +0100

Add /frt, aliases to commands and improved help

Diffstat:

Mtwitter/tweet.py19+++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/twitter/tweet.py b/twitter/tweet.py @@ -20,14 +20,21 @@ except: try: if status[0] == '/': command = status[1:].split(' ') - if command[0] == 'fav' and command[1] is not None: + if command[0] in ('f', 'fav', 'favorite'): api.request('favorites/create', {'id':command[1]}) - elif command[0] == 'rt' and command[1] is not None: - request = 'statuses/retweet/{!s}'.format(command[1]) - print(request) - api.request(request) + elif command[0] in ('rt', 'retweet'): + api.request('statuses/retweet/:{}'.format(command[1])) + elif command[0] in ('frt', 'favrt'): + api.request('favorites/create', {'id':command[1]}) + api.request('statuses/retweet/:{}'.format(command[1])) + elif command[0] == 'tweet': + print('No command is used to tweet, just put it without /tweet') else: - print(command[0], 'doesn’t exist') + print(command[0], 'doesn’t exist\nUsage:') + print('Favorite: /f /fav /favorite') + print('Retweet: /rt /retweet') + print('Favorite & Retweet: /frt /favrt') + print('To tweet just put it without any command. Image uploading not supported yet') else: if len(status) > 140: print('Tweets have a max of 140 charaters')