Python - Twitter

> Procedural Languages > Python

Table of Contents

1 - Snippet

1.1 - Search API

import urllib
import json
 
response = urllib.urlopen("http://search.twitter.com/search.json?q=gerardnico")
dictio = json.load(response)
for key in dictio:
    print key,":", dictio[key]

with the json library

completed_in : 0.03
max_id_str : 331834913596772352
since_id_str : 0
refresh_url : ?since_id=331834913596772352&q=gerardnico
results : [{u'iso_language_code': u'en', u'profile_image_url_https':....
since_id : 0
results_per_page : 15
query : gerardnico
max_id : 331834913596772352
page : 1
Advertising