At the client side, the AJAX style is implemented as Javascripts embeded in a HTML page, which makes it impossible to be called from JDK script engine, at least not in a straightforward way.
Davanum Srinivas has published an interesting blog on how to call google ajax search service in Java. He used an reverse engineering approach to capture the url that the javascript sent to the google server, by some TCP/IP monitor. By manipulate the captured url, it is able to call google search in Java. The url looks like:
"http://www.google.com/uds/GwebSearch?"callback=GwebSearch.RawCompletion&context=0&
lstkp=0&
rsz=small&
hl=en&
sig=8656f49c146c5220e273d16b4b6978b2&
q=Axis2&
key=xxxxxxxxxxxxxxxxxx&
v=1.0"
When rsz is set to small, four records are returned; when large, eight are returned.
The search result contains result objects in JSON format, which can be parsed using some JSON parser.
It is easy to call google AJAX search service in Java. The challenge is when we have the capability to google repeatedly, untiredly, in brute force, or in a massive way, anything interesting can we achieve then?
1 comment:
Loovely blog you have
Post a Comment