2nd Jul 2013 07:30am
1,116 views | 0 comments
Flattr this

The final stages of the transition from v1 to v1.1 of Twitter's API went fully complete 11th June 2013, however there's still a fair few people using v1 of the Twitter API and moaning that it's not working. Well obviously it's not going to work now as it's been totally switched off.

However updating to use v1.1 of the API is very simple.

Now before I start rambling on about how you can do things, I would like to point out that I am using Abraham Williams' Twitter OAuth class for this post (as it's the first and main one I've came across that handles everything I need it to do). You can get hold of it on Github by clicking here.

Now if you've got the current files from Github, then you will not need to update anything and can ignore the rest of this post (but stay tuned for the next ones - coming very soon). However if you're still using the original files (from before 12th June 2013) then you will need to make the following changes:

twitteroauth/twitteroauth.php

Find:

public $host = "https://api.twitter.com/1/";

Replace With:

public $host = "https://api.twitter.com/1.1/";


twitteroauth/OAuth.php

Find:

class OAuthException extends Exception { // pass

Replace With:

if (!class_exists('OAuthException')) { class OAuthException extends Exception { // pass }

That's it, we're all cooking on using v1.1 of the Twitter API. Keep an eye out for the rest of the Twitter Series.

For the rest of the tutorials in the Twitter Series, will be using them two files ("OAuth.php" and "twitteroauth.php") within a directory called "twitteroauth" (just the way they are when you downloaded them). So your directory structure should be:

+ Root Folder + twitteroauth - OAuth.php - twitteroauth.php

Additional Links
» Twitter OAuth Class (Github)
» Twitter Series Tutorials

 

Tweet ThisShare On FacebookShare On Google ReaderAdd To Del.icio.usShare On DiggShare On RedditShare On LinkedInShare On StumbleUpon

Comments

Post your comment...

Your Name:

Your Email:

Your Comment:

Are You Human?

Tick this box to confirm you're not a bot.

  • © Dale Hay, 2005 - 2016