How to Log your Twitter Follower Stats with IFTTT to a Google Spreadsheet

tstats GitHub repository
The tstats script (on GitHub) logs your Twitter Follower Stats with IFTTT to a Google Spreadsheet

How can we log the follower statistics for a Twitter account?

In order to store these stats, I’d like to use IFTTT’s new Maker channel that was introduced last month. I have created a simple Bash script (tstats.sh) to log this data to a spreadsheet in my Google Drive. I run this as a cron job every 24 hours.

Prerequisites

Ruby:

sudo apt-get install ruby-dev

Twitter CLI:

gem install t

Authorize your Twitter account:

t authorize

A Google account, as the log is saved to a spreadsheet in your Google Drive.

An IFTTT account.

Connect the Maker and Google Drive channels to your IFTTT account.

Usage

cd into the tstats directory and edit the script with your IFTTT secret key, your IFTTT trigger event name and your Twitter screen name. Make the script executable with:

chmod +x tstats.sh

Then simply run it with:

./tstats.sh

If you receive a „Congratulations“ message and an entry is added to your spread sheet, you can go ahead and add it to your cron to run at a predetermined time.

To have this script run every 24 hours, add this to your crontab (you may need to change the path):

42,09 * * * * /home/user/tstats/tstats.sh >/dev/null 2>&1

[Update 26 Jul 2018] Now on GitHub: Yes, three years later this script is still hot! However, WordPress is not the perfect place to host code. As part of my preparation for my TC18 session on Social Media in New Orleans, I moved the code to a GitHub repositroy: https://github.com/aloth/tstats