fatiharaci / spotweety

spotweety.club - a twitter analyzer for spotify
http://spotweety.club/
0 stars 0 forks source link

Collecting and alayzing 10.000 * 100 tweets takes 30 seconds! #15

Closed fatiharaci closed 7 years ago

fatiharaci commented 7 years ago

This is due to limit of 100 tweets per request of twitter API. It is not much but it could be enhanced due to user satisfaction.

fatiharaci commented 7 years ago

after using better sorting algorithm this time reduced to 14 seconds:

        sorted_tweets = sorted(parsed_tweets2, key=lambda x: parsed_tweets2[x]['count'], reverse=True)

        for i in range(0, tnum):
            if (top_songs_count > len(top_songs_array)):
                top_song = parsed_tweets2[sorted_tweets[i]]['text']
                if top_song not in top_songs_array:
                    top_songs_array.append(parsed_tweets2[sorted_tweets[i]]['text'])
                    index_array.append(sorted_tweets[i])
fatiharaci commented 7 years ago

This problem is solved by adding waiting button to the design