I was curious to track how my Twitter account’s followers and my account’s list memberships changed over time. The results of my tracking are on this webpage.
Twitter Followers – Twitter followers are other Twitter accounts who follow my account. A Twitter Follower may follow my account for a few days and then unfollow me at any time afterwards.
Twitter List Memberships – Twitter accounts can also create their own Lists and then add other Twitter accounts to the lists. For example a Twitter account may create a List called “Tweet about Big Data” to track Twitter accounts they believe “Tweet about Big Data”. Twitter accounts may add my account to their List and remove it at any time afterwards.
Twitter doesn’t provide historical data so you have to keep track of this yourself by retrieving and saving daily data but then you can compare daily changes to track new, active and dropped followers and list memberships.
To get the data from Twitter I created two Python scripts to run each night using Twitter’s API and Python’s Tweepy package.
These scripts retrieve my Twitter account’s followers and list memberships and insert the data into a MySQL database table along with a timestamp.
This table is then queried to get follower and list membership counts by timestamp date to get counts of new, active and dropped followers and list memberships by date.
The Twitter data retrieval, writing to database, and data querying are all done on a web server.
The query results are saved as csv files which are transferred from the web server to an AWS S3 folder so they can be used in an AWS S3 static website visualizations.
Here is the chart showing active followers by day, with counts of new follows and un-follows by day.
This chart shows active list memberships by day, with counts of new listings and un-listing by day:
The code for this will be posted soon.