I needed a way for users to be able to enter readable place names and
do searches restricted to the neighborhood. The search API only
supports lat,long so I had to implement some geocoding to translate
names into coordinates. I ended up using Yahoo's free GeoPlanet
service, with 50,000 requests possible per month.

Since I couldn't find any other public examples of how to do this
(though I'm sure this must be in a lot of code out there) I put up my
sample code:
http://petewarden.typepad.com/searchbrowser/2009/02/how-to-emulate-near-in-the-twitter-search-api-using-geoplanet.html

It's a small PHP file, and works just like the normal search API call
but with an additional near argument that gets translated by the
geocoding. I'd love to see some more explanation on the docs wiki of
this sort of workaround for 'near', but it seems that it's only
editable by Twitter employees? Facebook's more open editing policy
seems to work well for them.

cheers,
           Pete

Reply via email to