{UPDATE}

Well, seem with all the issues Twitter has been  having lately they have pushed this back a month, perhaps 2.  But dont get lacks, its going to happen, so you may as well get on it now.

The end time are nigh.  Yes, for all of us first gen Twitter App dev’s our old code is about to die on us.  The old way of sending authentication using a users name and password will officially lose support july 1. That means you had better get OAuth (or XAuth) up and running before hand. I have a feeling a lot of mashups might find a few broken pieces on July1 and whole sites that are not really supported anymore could die altogether.

Now replacing your old twitter class with one that supports OAuth is not all that bad.  In fact, if you waited like I have, you will find its easier then when OAuth rolled out.  In my case, I had an old library from Nick Beam (2007) that I have been updating, and decided to switch to a library from Abraham -> http://github.com/abraham/twitteroauth that seems pretty straightforward to implement and use.  Now, the issue I had to deal with was, how do I replace my existing library (which was build around username password) with this new library?  My first thought was to simply update my old twitter.class file with the new class file from abraham.  That turned out to be pretty messy.  So the next best step?  Simply move my existing function calls from the old class to the new one.  For example, this was from the 2007 class.  All I had to do to work with Abrahams library, was change the last line..

function getMentions_test($format, $page = 0, $since_id=0) {
$api_call = sprintf(“statuses/mentions.%s”, $format);
if ($page) {
$api_call .= sprintf(“?page=%d”, $page);
}
if ($since_id) {
$api_call .= sprintf(“?since_id=%d”, $since_id);
}
//echo ‘api ‘.$api_call.'<br>’;

//return $this->APICall($api_call, true);
return $this->get($api_call);
}

All I changed was the return $this->APICall() to return $this->get()

Tada! Update pretty much done.  Now there were some other things I had to change here and there, but that was about it.  Of course, if you wrote your code NOT having your API calls to twitter as a separate class, well then perhaps this is a good time to revise you code eh?  And I would get on it because again, you only have 2 weeks left.

Here is the direct work from Twitter….

The majority of Tweets are sent or read on applications built by the developer community. … Many developers have already switched their applications over to use OAuth, and we’re here to help for those who haven’t. If you are a developer and still need to make this necessary change, you can read more about the OAuth transition and the resources available to you on the Twitter developers website.

Share and Enjoy !

Shares