Example #1
0
    f = open('output.txt', 'r', encoding='utf-8')

    print('Reading output...')
    # go through each tweet
    for line in f.readlines():
        # print(line)
        # print("username: "******"tweet_name: " + get_tweet_name(line))
        # print("tweet_time: " + get_tweet_dt(line).__str__())
        # print("tweet_followers: " + get_num_followers(line))
        # print("tweet_retweets: " + get_num_retweets(line))
        tweets.append(line)
        username = th.get_username(line)
        tweet_id = th.get_tweet_name(line)
        tweet_dt = th.get_tweet_dt(line)

        # Add the user's number of tweets total
        if username in user_number_of_tweets_overall:
            user_number_of_tweets_overall[username] += 1
        else:
            user_number_of_tweets_overall[username] = 1

        # Add the user's followers
        # note, the else is removed
        # we want the MOST RECENT followers for that user
        if username not in user_number_of_followers:
            user_number_of_followers[username] = th.get_num_followers(line)

        # Add the tweets's retweets
        if tweet_id not in number_of_retweets_per_tweet: