I am trying to use twitter search web service in python. I want to call a web service like:
http://search.twitter.com/search.json?q=blue%20angels&rpp=5&include_entities=true&result_type=mixed
from my python program.
Can anybody tell me
-
how to use xmlhttprequst object in python
-
how to pass parameters to it, and
-
how to get the data in dictionary.
Here is my try:
import urllib
import sys
url = "http://search.twitter.com/search.json?q=blue%20angels&rpp=5&include_entities=true&result_type=mixed"
urlobj = urllib.urlopen(url)
data = urlobj.read()
print data
Thanks.
You don’t need “asynchronous httprequest” to use twitter search api:
There are probably several libraries that provide a nice OO interface around these http requests.
To make multiple requests concurrently you could use
gevent: