A little while ago, Twitter decided to get rid of “basic authentication” for all third party tools (i.e. login and passwords) and force them to use OAuth as a more secure and user-friendly means of using their service. This event, affectionately known as the OAuthcalypse among the tech community, caused many people to throw their hands up in disgust as they realized that many of their scripts and tools would now be obsolete – that is, unless they spent time and effort revamping them to use OAuth.
Luckily, there’s a simpler solution for all those folks out there – using a website that handles the OAuth handshake for you lets you essentially proxy your Twitter calls through an authorized site, meaning you can hang on to your scripts and tools with minimal modifications.
The easiest solution I’ve found out there is SuperTweet.net. Designed to transparently replace direct calls to Twitter, SimpleTweet does all the heavy lifting and has quite an extensive API to utilize. Setup is relatively quick and painless (see details below) and for the most simple one-line tweeting solutions, just requires you replacing your Twitter password with your SuperTweet password, and changing the URL you hit to the SimpleTweet gateway URL.
An alternate solution, and one I’ve had only partial success with, is Elliot Kember’s Simple Auth Twitter. Although it boasts an easier setup (basically, click one link and you’ve got everything set up for you), it appears to be more limited in what you can do on Twitter via the proxy, and requires you to change your format of your scripts to hit a custom URL for each status tweet. Although it worked for me on unix-based systems, I could not get it to work via curl for Windows.
My recommendation, if you like to tweet from the command line or have a script/tool that needs to do so, is use SimpleTweet.net to replace your old basic authentication calls to Twitter. It took me about 2 minutes to set up and edit my scripts to use this, and they’ve worked flawlessly since then. Sure, there’s a third party in the loop now, but if the alternative is learning OAuth or giving up on my scripts entirely, I’ll happily take the quick & dirty solution and go about the rest of my day doing something more fun.
How to Set Up SuperTweet.net – Step by Step instructions
1) If you’re not already signed in, login into Twitter via the Twitter homepage with the account you want to use with SuperTweet’s API Proxy
2) Go to the SuperTweet.net homepage and click the “Sign in With Twitter” button to get to the Twitter authorization page
3) Click the “Allow” button to allow “MyAuth API Proxy by supertweet.net” access to your Twitter account. This is the step where they’re setting up the OAuth handshake for you so you can use SuperTweet as a proxy without having to do OAuth yourself.
4) You’ll be returned to the SuperTweet site, with a page that shows the credentials that are set up for your account. Right now, the account is Inactive because you have not set up a password. Click the “Activate” link to set up a password.
4) On the next screen, enter the password you want to use with your command-line tools. Note: They recommend NOT using your Twitter password here to add a little extra safety to your account. Most command line tools are going to transmit this password in the clear, so it’s probably a good idea to use an alternate password.
Here’s an example to get you started – if you want to tweet your status from the command line, use the following one-liner:
curl -u your_twitter_username_here:your_SuperTweet_password_here -d status="Status you want tweeted goes here" http://api.supertweet.net/1/statuses/update.xml
(Curl for Windows uses arguments slightly differently, but it’s similar enough that I think you can figure it out.)
The full list of API calls is available here. Lots of possibilities out there if you want to get more complex, but I think most people just want their script/tool to be able to tweet status info based on the outcome of their script, which is what I’ve listed above.
Hope this helps you out, letting you continue to use those scripts/tools you wrote and Twitter broke with their OAuthcalypse!