X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=rainbowstream%2Frainbow.py;h=3a55c18ab5a6c06e058e021133a26654f292ea37;hb=e5fe55dbe729dddf0fa1a7499dfb0faff14c767b;hp=b65b705130d4c33ea3142c82fa5ce181864ab366;hpb=5b06fbffda826d50cf13a975f77888167a3bbf35;p=rainbowstream.git diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index b65b705..3a55c18 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -239,11 +239,8 @@ def init(args): c['message_dict'] = [] # Image on term c['IMAGE_ON_TERM'] = args.image_on_term - set_config('IMAGE_ON_TERM', str(c['IMAGE_ON_TERM'])) # Use 24 bit color c['24BIT'] = args.color_24bit - # Resize images based on the current terminal size - set_config('IMAGE_RESIZE_TO_FIT', str(c.get('IMAGE_RESIZE_TO_FIT', False))) # Check type of ONLY_LIST and IGNORE_LIST if not isinstance(c['ONLY_LIST'], list): printNicely(red('ONLY_LIST is not a valid list value.')) @@ -375,6 +372,21 @@ def view(): printNicely(red('A name should begin with a \'@\'')) +def view_my_tweets(): + """ + Display user's recent tweets. + """ + t = Twitter(auth=authen()) + try: + num = int(g['stuff']) + except: + num = c['HOME_TWEET_NUM'] + for tweet in reversed( + t.statuses.user_timeline(count=num, screen_name=g['original_name'])): + draw(t=tweet) + printNicely('') + + def search(): """ Search @@ -870,7 +882,7 @@ def mute(): rel = t.mutes.users.create(screen_name=screen_name[1:]) if isinstance(rel, dict): printNicely(green(screen_name + ' is muted.')) - c['IGNORE_LIST'] += [unc(screen_name)] + c['IGNORE_LIST'] += [screen_name] c['IGNORE_LIST'] = list(set(c['IGNORE_LIST'])) else: printNicely(red(rel)) @@ -1440,6 +1452,8 @@ def help_discover(): light_green('trend JP Tokyo') + '.\n' usage += s * 2 + light_green('home') + ' will show your timeline. ' + \ light_green('home 7') + ' will show 7 tweets.\n' + usage += s * 2 + light_green('me') + ' will show your latest tweets. ' + \ + light_green('me 2') + ' will show your last 2 tweets.\n' usage += s * 2 + \ light_green('notification') + ' will show your recent notification.\n' usage += s * 2 + light_green('mentions') + ' will show mentions timeline. ' + \ @@ -1764,6 +1778,7 @@ cmdset = [ 't', 'rt', 'quote', + 'me', 'allrt', 'conversation', 'fav', @@ -1812,6 +1827,7 @@ funcset = [ tweet, retweet, quote, + view_my_tweets, allretweet, conversation, favorite, @@ -1873,6 +1889,7 @@ def listen(): [], # tweet [], # retweet [], # quote + [], # view_my_tweets [], # allretweet [], # conversation [], # favorite