views:

204

answers:

3

How can I make a simple search on Twitter through PHP, Java, or CURL JSON?

A: 

The simplest way? http://twitter.com/#search?q=whatever - then substitute "whatever". You can use HttpClient's HttpGet for that in Java

You can add variations like "search API for user CNN" which would be http://twitter.com/#search?q=source%3AAPI%20@cnn

If want RSS instead of HTML use (for above query) http://search.twitter.com/search.atom?q=source%3AAPI%20@cnn

And there's whole Spritzer API - see my post @ http://is.gd/28Hkv

DroidIn.net
+1  A: 

Fetching JSON with Curl:

curl --data-urlencode "q=query here" http://search.twitter.com/search.json

See Twitter's API Reference for more details.

earl
+1  A: 

Twitter has a nice REST API for searching. The docs are here:

http://apiwiki.twitter.com/Twitter-Search-API-Method:-search

To search and get JSON back it's as easy as this:

$ curl http://search.twitter.com/search.json?q=stackoverflow
{"results":[{"text":"Saturday night and I'm reading http:\/\/stackoverflow.com\/ #dorkbot","to_user_id":.......
lost-theory