def run_listener():

        api = Actions.get_api()
        friend_ids = UserData.friend_ids()

        while True:

            try:

                myStreamListener = MyStreamListener()
                myStream = tweepy.Stream(auth=api.auth,
                                         listener=myStreamListener)

                myStream.filter(follow=friend_ids)

            except Exception as e:

                print(str(e) + '\n')
                continue
    def on_data(self, data):

        friend_ids = UserData.friend_ids()

        all_data = json.loads(data)
        tweet = all_data["text"]
        created_at = all_data["created_at"]
        username = all_data["user"]["screen_name"]
        user_id = all_data["user"]["id_str"]
        tweet_id = all_data["id"]
        reply_id = all_data["in_reply_to_status_id"]

        tweet_source = all_data["source"]
        tweet_source = str(re.search(r'\>(.*?)\<',
                                     tweet_source).group(0))[1:-1]

        tweet_data = [
            tweet, username, created_at, tweet_id, tweet_source, user_id,
            str(reply_id)
        ]

        if user_id in friend_ids:

            if '@BonneNick' in tweet:

                print('{}({}) - {}'.format(username, created_at, tweet))

                Actions.add_mention_db(tweet_data)

                if reply_id is not None:

                    AutoReply.check_4_id(Actions.get_api(), reply_id, tweet_id,
                                         username)

            else:

                print('{}({}) - {}'.format(username, created_at, tweet))

            print()

        return True