A tip for Google API experimenters

Check out Jython and use the Java API docs. Not only is Python a nicer language, but you can leave out the “get” and “set”. Place googleapi.jar in your jre/lib/ext directory and try the following:

import com.google
engine = com.google.soap.search.GoogleSearch()
engine.key = '00000000000000000000000'
engine.queryString = 'google api'
answer = engine.doSearch()
for result in answer.resultElements:
    print result.URL

(Replace 000… with your key)

Much nicer.

Comments are closed.