#NEWLINE# def google_search( query ) : #NEWLINE# #INDENT# query = urllib . urlencode ( { #NEWLINE# #INDENT# 'q' : query , #NEWLINE# #UNINDENT# } ) #NEWLINE# response = urllib . urlopen ( ( 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&' + query ) ) . read ( ) #NEWLINE# json = m_json . loads ( response ) #NEWLINE# results = json [ 'responseData' ] [ 'results' ] #NEWLINE# for result in results : #NEWLINE# #INDENT# title = result [ 'title' ] . replace ( '<b>' , '' ) . replace ( '</b>' , '' ) #NEWLINE# link = result [ 'url' ] #NEWLINE# print ( ( ( title + '; ' ) + link ) )