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

Request #17694 Support for users/lookup, geo/search, and geo/id
Submitted: 2010-08-11 19:19 UTC
From: steve_twitpic Assigned: izi
Status: Closed Package: Services_Twitter (version 0.6.2)
PHP Version: Irrelevant OS: FreeBSD
Roadmaps: (Not assigned)    
Subscription  


 [2010-08-11 19:19 UTC] steve_twitpic (Stephen Corona)
Description: ------------ We use Services_Twitter extensively at Twitpic and wanted to push some of the API endpoints that we added back to you. users/lookup - http://dev.twitter.com/doc/get/users/lookup geo/search - http://dev.twitter.com/doc/get/geo/search geo/id/ - http://dev.twitter.com/doc/get/geo/id/:place_id NOTE: I had to add user_id and screen_name as type "string" and not "id_or_screenname" because these parameters take a CSV list of ids or screenames (you can pull up to 100 users at a time with the API call). There may be a better way to implement this, but it was the easiest way for us. Test script: --------------- $twitter = new Services_Twitter; $twitter->users->lookup(array('user_id' => '12345')); $twitter->geo->search(array('lat'=>90, 'long'=>90)); $twitter->geo->id(array('place_id' => 'abcdef123456'));

Comments

 [2010-08-11 19:26 UTC] steve_twitpic (Stephen Corona)
Here is the patch- the "Add patch" system is not letting me upload patch.txt for whatever reason. 239a240,245 > <endpoint name="lookup" method="GET" auth_required="true" min_args="1"> > <formats>xml,json</formats> > <param name="user_id" type="string" required="false"/> > <param name="screen_name" type="string" required="false"/> > <param name="include_entities" type="boolean" required="false"/> > </endpoint> 471a478 > <param name="result_type" type="string" required="false"/> 502c509,527 < --- > <!-- Geo API Methods --> > <category name="geo"> > <endpoint name="search" method="GET" min_args="1" auth_required="false"> > <formats>json</formats> > <param name="lat" type="lat" required="false"/> > <param name="long" type="long" required="false"/> > <param name="query" type="string" required="false"/> > <param name="ip" type="string" required="false"/> > <param name="granularity" type="string" required="false"/> > <param name="accuracy" type="string" required="false"/> > <param name="max_results" type="integer" required="false"/> > <param name="contained_within" type="string" required="false"/> > <param name="autocomplete" type="boolean" required="false"/> > </endpoint> > <endpoint name="id" method="GET" auth_required="true" routing="/geo/id/:place_id"> > <formats>json</formats> > <param name="place_id" type="string" required="true"/> > </endpoint> > </category>
 [2010-08-14 18:03 UTC] doconnor (Daniel O'Connor)
Cheers for the patch Steve!
 [2010-08-14 18:03 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Analyzed
 [2010-08-15 13:52 UTC] izi (David Jean Louis)
-Status: Analyzed +Status: Feedback -Assigned To: +Assigned To: izi
Hi Stephen, thanks ! I've applied your patch (along with some minor updates): http://svn.php.net/viewvc/pear/packages/Services_Twitter/trunk/data/api.xml?r1=302262&r2=302261&pathrev=302262 But for some reason I'm getting 400 Bad request errors with the geo methods, could you have a look at it please ? -- David
 [2010-08-19 05:53 UTC] steve_twitpic (Stephen Corona)
It works for me. Try this: $t = new Services_Twitter(); print_r($t->geo->id("247f43d441defc03")); print_r($t->geo->search(array("lat" => "37.7821120598956", "long" => "-122.400612831116")));
 [2010-09-12 22:32 UTC] shupp (Bill Shupp)
-Status: Feedback +Status: Closed
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/