'Follows anyone who tweets about a phrase (hashtag, word, etc.).'

def auto_follow(self, phrase, count=100, result_type='recent'):

    result = self.search_tweets(phrase, count, result_type)
    following = self.get_follows_list()
    do_not_follow = self.get_do_not_follow_list()
    for tweet in result['statuses']:
        try:
            if ((tweet['user']['screen_name'] != self.BOT_CONFIG['TWITTER_HANDLE']) and (tweet['user']['id'] not in following) and (tweet['user']['id'] not in do_not_follow)):
                self.wait_on_action()
                self.TWITTER_CONNECTION.friendships.create(user_id=tweet['user']['id'], follow=False)
                following.update(set([tweet['user']['id']]))
                print(('Followed    %s' % tweet['user']['screen_name']), file=sys.stdout)
        except TwitterHTTPError as api_error:
            if ('unable    to    follow    more    people    at    this    time' in str(api_error).lower()):
                print('You    are    unable    to    follow    more    people    at    this    time.    Wait    a    while    before    running    the    bot    again    or    gain    more    followers.', file=sys.stderr)
                return
            if ('already    requested    to    follow' not in str(api_error).lower()):
                print(('Error:    %s' % str(api_error)), file=sys.stderr)
