From d6c61fb58c715d481c0bcd601ce8071f271d0d4f Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Thu, 26 May 2011 18:40:42 +0000 Subject: Fixed following too many issue. --- JKTwitterBot/src/thebot.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/JKTwitterBot/src/thebot.py b/JKTwitterBot/src/thebot.py index 678c95a..3a72915 100644 --- a/JKTwitterBot/src/thebot.py +++ b/JKTwitterBot/src/thebot.py @@ -131,7 +131,13 @@ def oursleep(amt): else: time.sleep(amt) - +def follow_more(): + if len(friends) > 0: + for i in range(100): + if len(friends) > 0: + follow_user(friends.pop()) + + ######################### # Execution starts here # ######################### @@ -192,10 +198,6 @@ if __name__ == '__main__': # Prepare Eliza (code from the_shrink.py) doctor = eliza.eliza() - # adds all friends from friends.txt - for friend in friends: - follow_user(friend) - while True: # We sleep between midnight at 6 am. hour = datetime.now().hour @@ -203,6 +205,8 @@ if __name__ == '__main__': # Sleep until 6 am. oursleep((6 - hour) * 3600) + # Follow 100 more users + follow_more() # Reply to tweets directed to us reply_to_tweets() -- cgit v1.2.3