A few years ago I wrote a blogpost that made an effort to explain how you can set up an Excel sheet that is able to post tweets on Twitter. Figuring out how to do it was quite a challenge, and it is a tedious job to get it right. Unfortunately, it is still not that easy for most people, even when the process is explained step by step. However there are great advantages to being able to use Excel for certain Twitter tasks. To make it much easier to use Excel, a website was set up called Exceltweets, which tries to take most of the complexity out of the process. An additional advantage of using Exceltweets is that a user does not need to set up a Twitter application to perform tasks, and sample Excel sheets can be used immediately as a starting point for users who want to create Excel sheets to their own specifications. The latest sample Excel sheet makes it possible for an account to retrieve Twitter profiles of their followers and/or following, and in this blogpost it will be explained how it works.
The first step for anyone who want to use Exceltweets, is to go to the website and sign in with Twitter. Exceltweets is a Twitter client and can access the API on behalf of accounts that have authorized Exceltweets to perform tasks. The sign in process takes care of this and is very straight forward. Subsequently a secret code has to be created by the Twitter account. This code is encrypted and is used later when requests are sent to Exceltweets from an Excel sheet to perform Twitter tasks. When an Excel code has been created the sample Excel sheets can be downloaded and immediately Twitter tasks can be performed.
To perform tasks with an Excel sheet, calls to Exceltweets methods need some parameters. Every call requires the account name and the Excel code, which authenticates the account with Exceltweets. Depending on the task, additional parameters need to be submitted. In most cases this just means putting values in a cell. Of course Twitter API limits have to be respected, and in the case where someone wants to retrieve all followers of an account, two limits put restrictions on what can and what cannot be done. First, followers are retrieved by user ID. Twitter only allows 15 requests per 15 minute period to the method that reports user ID's of followers. Because each request can report up to 5,000 user ID's, up to the last 75,000 followers of an account can be retrieved. For most accounts this is not a problem, because the vast majority of Twitter accounts have much less than 75,000 followers. Next, profile information has to be looked up, and the Twitter method that does this allows 180 requests per 15 minute period. Since each request can give up to 100 user profiles, 18,000 profiles can be requested in a 15 minute period. When an account has more than 18,000 followers, it is necessary to wait for 15 minutes before additional requests can be made.
In the sample Excel sheets values need to be given for the number of requests that are required. An effort has been made to prevent requests to the Twitter API that would result in error messages. When all followers are retrieved in the Excel sheet, users can use the data for further processing, if required.
The VBA code that performs the tasks is easily accessible, so anyone with knowledge of VBA can check the code and customize Excel sheets depending on their requirements. It is highly advisable that any customization tries to avoid making unnecessary calls to both Exceltweets and to Twitter, to avoid errors. Anyone who uses Twitter needs to adhere to the Twitter Terms of Service and rules, and it is also important that Twitter usage limits are respected to avoid suspension by either Exceltweets or Twitter.