Twitter Opens up OAuth, Where’s Perl?

Twitter opened up their OAuth implementation last week. It’s a much welcome aspect of working with Twitter’s API since we’re planning on implementing some functionality into Semblr that uses Twitter. Hence, understanding OAuth and prototyping it’s use was important for us.

My problem with Twitter’s implementation is that the documentation is sparse and there isn’t a single example in Perl or Java. Maybe these two languages aren’t cool enough to warrant examples but to me, they’re important because they’re all I know. I spent some time over the last few days trying to implement OAuth for Twitter in my Perl scripts. The example below is a bit messy but it works.

It will create a few temp files, request a token for you, ask you to go to the URL printed to authorize the application. When you’ve authorized the application, run the script again and it will allow you to submit a status update.

Related Posts: