We don't recommend our dev console really for all the reasons you list --
you'll find much more joy in using Apigee's Twitter console at
http://app.apigee.com/console/twitter
You may also want to consider Twurl at
http://github.com/marcel/twurl-- Also, since this method doesn't
require authentication, you can use curl.

I'm not sure how you're making the request in PHP, but it's not usual for
this API to respond with an HTML page unless there's a general site failure.

Here's an example of your request via curl:

 curl http://api.twitter.com/1/geo/search.json?query=London
>
> {"result":{"places":[{"url":"http:\/\/api.twitter.com\/1\/geo\/id\/14d17c02200b6fc8.json","country":"United
>> States","contained_within":[{"url":"http:\/\/api.twitter.com\/1\/geo\/id\/988bfa67502cf995.json","country":"United
>> States","bounding_box":{"type":"Polygon","coordinates":[[[-94.452875,36.401928],[-94.160558,36.401928],[-94.160558,36.499615],[-94.452875,36.499615]]]},"attributes":{},"place_type":"city","name":"Bella
>> Vista","full_name":"Bella Vista,
>> AR","country_code":"US","id":"988bfa67502cf995"}],"place_type":"neighborhood","attributes":{},"bounding_box":{"type":"Polygon","coordinates":[[[-94.257714,36.436687],[-94.250204,36.436687],[-94.250204,36.441597],[-94.257714,36.441597]]]},"full_name":"London,
>> Bella
>> Vista","name":"London","id":"14d17c02200b6fc8","country_code":"US"},{"url":"http:\/\/
>> api.twitter.com
>> \/1\/geo\/id\/eeb8908666aad27c.json","country":"Canada","contained_within":[{"url":"http:\/\/
>> api.twitter.com\/1\/geo\/id\/6c6e160a511c48b7.json","country":"Canada","bounding_box":null,"attributes":{},"place_type":"admin","name":"London","full_name":"London,
>> ON","country_code":"CA","id":"6c6e160a511c48b7"}],"place_type":"neighborhood","attributes":{},"bounding_box":{"type":"Polygon","coordinates":[[[-81.261064,42.972758],[-81.225745,42.972758],[-81.225745,43.000241],[-81.261064,43.000241]]]},"full_name":"Central
>> London, London","name":"Central
>> London","id":"eeb8908666aad27c","country_code":"CA"},{"url":"http:\/\/
>> api.twitter.com
>> \/1\/geo\/id\/cbc189488163dafc.json","country":"Canada","contained_within":[{"url":"http:\/\/
>> api.twitter.com\/1\/geo\/id\/6c6e160a511c48b7.json","country":"Canada","bounding_box":null,"attributes":{},"place_type":"admin","name":"London","full_name":"London,
>> ON","country_code":"CA","id":"6c6e160a511c48b7"}],"place_type":"neighborhood","attributes":{},"bounding_box":{"type":"Polygon","coordinates":[[[-81.313035,42.975341],[-81.256947,42.975341],[-81.256947,42.998583],[-81.313035,42.998583]]]},"full_name":"West
>> London, London","name":"West
>> London","id":"cbc189488163dafc","country_code":"CA"},{"url":"http:\/\/
>> api.twitter.com\/1\/geo\/id\/03b71c10e43969a2.json","country":"United
>> States","contained_within":[{"url":"http:\/\/api.twitter.com\/1\/geo\/id\/3df0e3eb1e91170b.json","country":"United
>> States","bounding_box":{"type":"Polygon","coordinates":[[[-83.183103,39.808631],[-82.771378,39.808631],[-82.771378,40.157317],[-83.183103,40.157317]]]},"attributes":{},"place_type":"city","name":"Columbus","full_name":"Columbus,
>> OH","country_code":"US","id":"3df0e3eb1e91170b"}],"place_type":"neighborhood","attributes":{},"bounding_box":{"type":"Polygon","coordinates":[[[-83.03284116,39.80843604],[-82.99606716,39.80843604],[-82.99606716,39.83236002],[-83.03284116,39.83236002]]]},"full_name":"West
>> London, Columbus","name":"West
>> London","id":"03b71c10e43969a2","country_code":"US"},{"url":"http:\/\/
>> api.twitter.com\/1\/geo\/id\/3bafd8b7c26533d1.json","country":"United
>> States","contained_within":[{"url":"http:\/\/api.twitter.com\/1\/geo\/id\/1c69a67ad480e1b1.json","country":"United
>> States","bounding_box":{"type":"Polygon","coordinates":[[[-95.909985,29.537014],[-95.014496,29.537014],[-95.014496,30.110732],[-95.909985,30.110732]]]},"attributes":{},"place_type":"city","name":"Houston","full_name":"Houston,
>> TX","country_code":"US","id":"1c69a67ad480e1b1"}],"place_type":"neighborhood","attributes":{},"bounding_box":{"type":"Polygon","coordinates":[[[-95.490251,29.988164],[-95.487544,29.988164],[-95.487544,29.990294],[-95.490251,29.990294]]]},"full_name":"London
>> Park, Houston","name":"London
>> Park","id":"3bafd8b7c26533d1","country_code":"US"}]},"query":{"url":"http:\/\/
>> api.twitter.com
>> \/1\/geo\/search.json?trim_place=false&query=London&autocomplete=false&accuracy=0&granularity=neighborhood","type":"search","params":{"trim_place":false,"query":"London","autocomplete":false,"accuracy":0,"granularity":"neighborhood"}}}
>
>
@episod <http://twitter.com/episod> - Taylor Singletary - Twitter Developer
Advocate


On Fri, Feb 11, 2011 at 2:36 AM, Matt <guitarroman...@gmail.com> wrote:

> Hi there.
>
> I want to grab a set of tweets from an arbitrary location.
>
> I'm using http://dev.twitter.com/console to play with.
>
> Selected the geo/search method. Added parameters of "query" and
> "london". Hit "Send", get back:
>
> {
>  "errors": [
>    {
>      "code": 12,
>      "message": "You must provide valid coordinates, IP address,
> query, or attributes."
>    }
>  ]
> }
>
> I've also tried calling the method via PHP and don't even get the
> error, rather it returns some HTML that looks like a Twitter page.
>
> Can anyone help me figure out how to get data back from this and what
> I'm doing wrong?
>
> Incidentally, that dev console is maddeningly frustrating to use since
> it immediately forgets the entered parameters as soon as you submit a
> query. Couldn't it submit via ajax, too?
>
> thanks,
> Matt
>
>

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk

Reply via email to