diff options
| author | BasherSlash@gmail.com <BasherSlash@gmail.com> | 2011-05-21 02:04:45 +0000 | 
|---|---|---|
| committer | BasherSlash@gmail.com <BasherSlash@gmail.com> | 2011-05-21 02:04:45 +0000 | 
| commit | ced7ae618893a75ba110dcbd92f005f52b4247f1 (patch) | |
| tree | 88b3033cb6cbacce3aeeb2702aae2dc8e2d95781 | |
| parent | ed046f8df834069c02abb1213ced9908a8b6d62f (diff) | |
| -rw-r--r-- | JKTwitterBot/src/thebot.py | 21 | 
1 files changed, 12 insertions, 9 deletions
| diff --git a/JKTwitterBot/src/thebot.py b/JKTwitterBot/src/thebot.py index 3804802..1258a84 100644 --- a/JKTwitterBot/src/thebot.py +++ b/JKTwitterBot/src/thebot.py @@ -91,8 +91,8 @@ if __name__ == '__main__':              poster.friendships.destroy(id=user)
              poster.friendships.create(id=user)
 -    for friend in friends: # adds all friends from friends.txt
 -        follow_user(friend)
 +    #for friend in friends: # adds all friends from friends.txt
 +     #   follow_user(friend)
      while True:
          results = reader.search(q=username, since_id=lastid)['results']
 @@ -121,18 +121,18 @@ if __name__ == '__main__':                      print 'Last id replied = ', lastid
                      with open(lastid_filename, 'w') as f:
                          f.write(lastid)
 -            time.sleep(30)         
 +            time.sleep(1)         
          if (count == len(tweet)-1):
              count = 0
          print count 
          print tweet[count]
          #status_update(tweet[count]) # post a status update
          print 'Now sleeping... \n'
 -        time.sleep(120) # set at 5min but is at 2min
 -        print question[count] 
 +        time.sleep(1) # set at 5min but is at 2min
 +        #print question[count] 
          #status_update(question[count])
          print 'Now sleeping... \n' 
 -        time.sleep(120) # set for 2min.
 +        time.sleep(1) # set for 2min.
          # may want to add ask questions to friends too
          # Ask questions specific to followers
          connection = urllib2.urlopen('http://api.twitter.com/1/statuses/followers.json?screen_name=' + username)
 @@ -149,12 +149,15 @@ if __name__ == '__main__':          for x in range(len(friend_obj)):
              supfriend = friend_obj[x]
              friend_list.append(supfriend[u'screen_name'])
 -        postnumber = count
 +        if count == len(question):
 +                postnumber = 0 
 +        else: postnumber = count
          for follow_me in friend_list:
              if not (follow_me in following_list):
 -                post = follow_me + ' ' + question[postnumber]     
 +                print 'fix this'
 +                #post = follow_me + ' ' + question[postnumber]     
                  #status_update(post) #May want to ask everyone questions regardless of friendship 
 -                time.sleep(30)
 +                time.sleep(1)
                  postnumber = postnumber + 1
              if (follow_me in following_list):#Left open if we want to make specific questions to friends
                  print follow_me 
 | 
