OAuth: not as easy as I hoped

I put together a demo/thought experiment to test “is there an easy way to filter your twitter stream using tag-cloud like UI – things like fading the colors or scaling the fonts.   Easy to build for myself, but when I wanted feedback from friends, the first response was a (in hindsight perfectly reasonable) reaction of “No way am I typing my twitter password into your form – I trust you Benjamin, but not THAT much!”

Solution: do it the “right” way using oAuth.   There are some great tutorials on oAuth and a standard pre-packaged PHP library on Google code, and another for Twitter in particular.  But every method ran into problems.  The PHP library wasn’t clear on how to use it to work with the slightly more complex process flow.  The twitter oAuth code threw lots of warnings when you turned on error warnings.

So, instead of building “down” from the oAuth standard, I pulled out the chunks of code I needed and built “up” from the oAuth steps necessary for twitter in particular.  Success!

So, for anyone struggling to get oAuth working with twitter (or with other applications), I offer up a minimal PHP oAuth class.  Enjoy, and I hope it saves you some time or helps clarify just what is going on during the oAuth process.  Check it out on Sourceforge in the PHPoetry Project.

PS: I welcome updates/bugfixes/code suggestions.

Originally Posted: May 15th, 2009
 ---------------

And, perhaps the best comment I've ever had:

Ben,  Awesome code. Simplest oauth I’ve seen. Damn it’s been a pain in my arse. But hey the whole robust_call thing. I couldn’t find the utils file. It’s at http://phpoetry.svn.sourceforge.net/viewvc/phpoetry/class/   For anyone else who could not find it.
Tx man

Comments

Popular posts from this blog

Visualizing the user post migration paths across Reddit to extract linked communities

Why people don't like Product Managers

Inability to visualize the scale of our national debt