Exit While loop instead of hangup all application.
authorOrakaro <nhatminh_179@hotmail.com>
Sun, 11 Dec 2016 13:24:02 +0000 (22:24 +0900)
committerOrakaro <nhatminh_179@hotmail.com>
Sun, 11 Dec 2016 13:29:07 +0000 (22:29 +0900)
rainbowstream/rainbow.py

index 118667c674e7ce41aa2a50db2a0b1fd1e4ba57b2..a499f957bf519875b062352368eb7a1724af299f 100644 (file)
@@ -938,8 +938,9 @@ def ls():
         # 300 users means 15 calls to the related API. The rate limit is 15
         # calls per 15mn periods (see Twitter documentation).
         if ( number_of_users % 300 == 0 ):
-            printNicely( '(waiting 16mn for rate limits reasons...)' )
-            time.sleep(16*60)
+            printNicely(light_yellow( 'We reached the limit of Twitter API.' ))
+            printNicely(light_yellow( 'You may need to wait about 15 minutes.' ))
+            break
 
     printNicely('All: ' + str(number_of_users) + ' ' + d[target] + '.')