Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.7.0

Bug #20009 Does not work since Twitter API 1.0 has been discontinued
Submitted: 2013-07-15 12:02 UTC
From: prox Assigned: doconnor
Status: Closed Package: Services_Twitter (version 0.6.3)
PHP Version: 5.4.17 OS: FreeBSD 9.0
Roadmaps: (Not assigned)    
Subscription  


 [2013-07-15 12:02 UTC] prox (Mark Kamichoff)
Description: ------------ It appears that Services_Twitter uses the 1.0 version of the Twitter API. This has been discontinued recently: https://dev.twitter.com/blog/api-v1-retirement-final-dates All code that uses Services_Twitter now results in an API error of "Gone." This renders Services_Twitter useless. Test script: --------------- # $config is populated with correct values require_once("Services/Twitter.php"); try { $twitter = new Services_Twitter(); $oauth = new HTTP_OAuth_Consumer( $config['twitter']['consumer_key'], $config['twitter']['consumer_secret'], $config['twitter']['oauth_token'], $config['twitter']['oauth_token_secret']); $twitter->setOAuth($oauth); $res = $twitter->statuses->friends_timeline(); foreach ($res as $status) { print "User Name: {$status->user->screen_name}\n"; print "Status: {$status->text}\n"; } $twitter->account->end_session(); } catch (Services_Twitter_Exception $e) { print "Error: ". $e->getmessage() . "\n"; } Expected result: ---------------- A list of user names and status updates from the friends timeline. Actual result: -------------- Error: Gone

Comments

 [2013-08-25 07:24 UTC] mecu (Michael Hoppes)
 [2013-08-25 07:25 UTC] mecu (Michael Hoppes)
On Line 115 of Twitter.php, change: public static $uri = 'http://api.twitter.com/1'; to public static $uri = 'http://api.twitter.com/1.1'; Solved my problem encountering the "Gone".
 [2013-08-27 07:52 UTC] prox (Mark Kamichoff)
Thanks! I can confirm that this patch works for me (along with changing "friends_timeline" to "home_timeline" in the sample code).
 [2013-08-27 19:04 UTC] ashnazg (Chuck Burgess)
This fix appears to already be in place in the source code (https://github.com/pear/Services_Twitter/)... just needs to be included in a new release. Shoot an email to the pear-dev mailing list to get one of the superusers to roll up a new release, as I don't think the maintainers are still active.
 [2014-04-20 09:49 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Closed -Assigned To: +Assigned To: doconnor
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.