The OAuthpocalypse and Keynote Tweet

Monday, 13. September 2010

The Twitter OAuthpocalypse arrived on September 1st. Starting on that date Twitter API clients are required to use OAuth and are no longer allowed to use basic authentication. This change broke more than a few applications that were unprepared for the change. One of those apps is Keynote Tweet.

Keynote Tweet is a simple AppleScript utility that allows you to send tweets from your Keynote presentations. Keynote Tweet uses the curl command-line utility to submit tweets to the Twitter API. Unfortunately there is no easy way to implement OAuth using the curl command-line. It also appears that it would be very difficult to implement OAuth directly in AppleScript.

One solution to making Keynote Tweet work again is to replace curl with twurl. twurl is a curl-like command-line utility for the Twitter API written in Ruby. twurl’s installation and OAuth setup is simple. The twurl syntax is not identical to curl’s, but it is simple to swap twurl out for curl in the Keynote Tweet AppleScript. Simply change the call to curl:

do shell script "curl --user " & twitter_login & " --data-binary " & twitter_status & " http://twitter.com/statuses/update.json"
 

To a call to twurl:

do shell script "twurl -d " & twitter_status & " /1/statuses/update.xml"
 

The keyring code in the original script is no longer necessary and can be ripped out of the script. You can download the updated script and documentation here:

Download Keynote Tweet 2
 

Share 'The OAuthpocalypse and Keynote Tweet' on Delicious Share 'The OAuthpocalypse and Keynote Tweet' on Facebook Share 'The OAuthpocalypse and Keynote Tweet' on Google Buzz Share 'The OAuthpocalypse and Keynote Tweet' on Google Reader Share 'The OAuthpocalypse and Keynote Tweet' on LinkedIn Share 'The OAuthpocalypse and Keynote Tweet' on Twitter Share 'The OAuthpocalypse and Keynote Tweet' on Email