Tool for automating management of Twitter lists

Managing long Twitter lists can be a pain, especially when you need to manually check who is or is not a member of a particular list. @JuliaBramble, a social media manager, mentioned this as a particular problem when trying to organise a client’s followers and I thought I could put together something using Google Docs and the Twitter API to solve the problem. As a result, with a bit of setup, you can use the tool below to help manage twitter membership lists.

This article and tool could not have been put together without information and code from @mhawksey and his many great articles on Google Docs and Twitter API integration: http://mashe.hawksey.info/2011/03/export-twitter-followers/

If you’re so excited that you can’t wait to get your hands on the tool (or already know about Consumer Keys and APIs) you can get hold of the Google Docs spreadsheet here (http://bit.ly/twitterlistmanage) – remember to make a copy and follow the instructions.

Managing Twitter lists manually – the problem

Well, it’s something like this:

Twitter list management problem identified by social media manager

“Tidying a client’s twitter followers into lists literally one-by-one at the mo. Anyone know of an app I can use which would show up just those that aren’t already in a list, please?”

Of, course, the problem applies equally to Twitter friends as well as followers.

So how does this tool help manage lists?

In short, it shows you a breakdown of which follower (or friend) is in which list.

It also works with any user, though it only shows membership of private lists for the ‘authorised user’ (more about that in a moment). Here’s an example of the kind of output you get:

Twitter list management

 

Note, you only (normally) have to do steps 1 – 7 once.
  1. Make a copy of the google spreadsheet that you can find here: http://bit.ly/twitterlistmanage  (File > Make a copy…)
  2. Register for an API key with Twitter at http://dev.twitter.com/apps/new (if you’ve already registered a Google Spreadsheet/Twitter mashup you can reuse your existing Consumer Key/Consumer Secret).
    In the form these are the important bits:

    • Application Website = anything you like
    • Application Type = Browser
    • Callback URL = https://spreadsheets.google.com/macros
    • Default Access type = you only need Read-only for the list manager to work
  3. Once finished filling in the form and accepting Twitter’s terms and conditions you’ll see a summary page which includes a Consumer Key and Consumer Secret. Take a copy of these as you’ll need them later.
  4. In this spreadsheet from the menu, select Twitter > Configure. You may need to run this twice, the first time to authorise the script.
  5. In the Configure Spreadsheet box enter your Consumer Key/Consumer Secret saved from step 3. Be careful not to add any spaces at the end of the values you’re entering.
  6. Select Tools > Scripts > Script Manager … and from the Script Manager window select authorize (it should be the first entry in the list) then click Run.
  7. This should bring up an authorisation message box, click on Authorize.
  8. In the Twitter authorisation window enter your login details if required and select ‘Allow’. Note, if you want to manage private lists, make sure you log in here with the Twitter user for whom you wish to manage private lists (otherwise you’ll only be able to work on public lists until you go through the steps here)
  9. Close the Script Manager window then select Twitter > Verify Twitter auth in the menu of the main spreadsheet. You should get a popup indicating that you have successfully connected to Twitter
  10. Now select Twitter > Get Lists from the menu, enter the twitter user for which you wish to retrieve lists. The results should appear in the Lists sheet along with some information like member count, public/private status
  11. Now select the ‘followers’ sheet and then select Twitter > Get Friends or Followers from the menu and enter the user for whom you wish to get the followers/friends. (Note the name you enter here can be different to the name you used in step 10.) After a moment, the list of followers should appear in column A and a ‘TRUE’ against which lists they’re members of. (You may have to copy the formulas for the TRUE calculation if you have many followers)
  12. You can repeat step 11 with the ‘friends’ tab for friends.
  13. 13. If you start seeing odd things, or no results, select Twitter > Check rate limit from the menu to check whether you have gone over the Twitter API rate limit (350/hour). The popup shows you how many calls you have remaining and when that count will be reset: wait till the reset time to try again (note the time shown may be GMT rather than BST)
Changing the authorised user to work on other private lists
If you’re working as a social media manager and looking after Twitter accounts for multiple clients, you may want to manage private lists for more than one Twitter account. You can do this in a couple of different ways:
  • The easiest is to make a copy of the spreadsheet and run through steps 1-13 above, or
  • To re-use the same spreadsheet, the account you used authorised in step 8, log into the Twitter web application then go to Settings. Under Applications you should see your app listed, simply revoke access and go through steps 6 onwards again.
Final thoughts
I do hope you find this useful – it’s somewhat of a cobbled-together affair, but it certainly does the job. If you have any problems with it drop me a line in the comments and I’ll see if I can help.
With a bit of tweaking this tool could be enhanced to allow automatic adding/removing of list members, let me know if you think that would be a useful update (though you may want to check out Matt’s article here for something that pretty much does the job: http://mashe.hawksey.info/2010/11/auto-twitter-list/)
Finally, if you find it useful or interesting, feel free to link to this article with this short link: http://bit.ly/twitter-list-manage-article
Like it, share itTweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Email this to someoneShare on RedditShare on StumbleUpon
Like it, share itTweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Email this to someoneShare on RedditShare on StumbleUpon

Comments are closed.