X-Git-Url: https://vcs.fsf.org/?p=rainbowstream.git;a=blobdiff_plain;f=rainbowstream%2Frainbow.py;h=692a4ac47294c7dc5d0cf68ed7371c98bc9b7ff4;hp=b15ef593111f8746e293f9ba6211e8dbce52aa55;hb=cd5cfee01d36b588ba85d55d9504ff6435440de5;hpb=1d9cbc8a58893c5bd76d56176cd2181a65fbe570 diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index b15ef59..692a4ac 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -375,6 +375,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 @@ -1491,6 +1506,8 @@ def help_tweets(): usage += s * 2 + \ light_green('share 12 ') + ' will get the direct link of the tweet with ' + \ light_yellow('[id=12]') + '.\n' + usage += s * 2 + \ + light_green('mytw 2 ') + ' will show your last two tweets.\n' usage += s * 2 + \ light_green('del 12 ') + ' will delete tweet with ' + \ light_yellow('[id=12]') + '.\n' @@ -1764,6 +1781,7 @@ cmdset = [ 't', 'rt', 'quote', + 'mytw', 'allrt', 'conversation', 'fav', @@ -1812,6 +1830,7 @@ funcset = [ tweet, retweet, quote, + view_my_tweets, allretweet, conversation, favorite, @@ -1873,6 +1892,7 @@ def listen(): [], # tweet [], # retweet [], # quote + [], # view_my_tweets [], # allretweet [], # conversation [], # favorite