I’ve mentioned before how I’m using Abraham Williams’s PHP library for Twitter OAuth for various projects. With the impending decommissioning of version 1.0 of the Twitter API the question has come up as to how to edit this library so it uses version 1.1 of the Twitter API instead. It’s actually quite simple:
- Open twitteroauth.php.
- Go to line 21 where is says ‘public $host = “https://api.twitter.com/1/”;’
- Change this line to ‘public $host = “https://api.twitter.com/1.1/”;’
- Save the file.
That’s it! You’re now using Twitter API 1.1.