Reversed sorting for tweets in list
[rainbowstream.git] / rainbowstream / rainbow.py
index 49e3308f7fe70654b3a8c33ee4a1cd8b70f49280..c18fe15c349d798dad0d66430671877b170e8c8f 100644 (file)
@@ -489,15 +489,19 @@ def share():
     t = Twitter(auth=authen())
     try:
         id = int(g['stuff'].split()[0])
+        tid = c['tweet_dict'][id]
     except:
-        printNicely(red('Sorry I can\'t understand.'))
+        printNicely(red('Tweet id is not valid.'))
         return
-    tid = c['tweet_dict'][id]
     tweet = t.statuses.show(id=tid)
     url = 'https://twitter.com/' + \
         tweet['user']['screen_name'] + '/status/' + str(tid)
-    os.system("echo '%s' | pbcopy" % url)
-    printNicely(green('Copied tweet\'s url to clipboard.'))
+    import platform
+    if platform.system().lower() == 'darwin':
+        os.system("echo '%s' | pbcopy" % url)
+        printNicely(green('Copied tweet\'s url to clipboard.'))
+    else:
+        printNicely('Direct link: ' + yellow(url))
 
 
 def delete():
@@ -899,7 +903,7 @@ def list_home(t):
         owner_screen_name=owner,
         count=c['LIST_MAX'],
         include_entities=False)
-    for tweet in res:
+    for tweet in reversed(res):
         draw(t=tweet)
     printNicely('')
 
@@ -1413,8 +1417,8 @@ def help_tweets():
         light_green('ufav 12 ') + ' will unfavorite tweet with ' + \
         light_yellow('[id=12]') + '.\n'
     usage += s * 2 + \
-        light_green('share 12 ') + ' will copy the url of the tweet with ' + \
-        light_yellow('[id=12]') + ' to your clipboard.\n'
+        light_green('share 12 ') + ' will get the direct link of the tweet with ' + \
+        light_yellow('[id=12]') + '.\n'
     usage += s * 2 + \
         light_green('del 12 ') + ' will delete tweet with ' + \
         light_yellow('[id=12]') + '.\n'