hi,
I have found one post which is answered by respected "Jgeerdes" post
name "Google AJAX search API in Java application". Here though my
question is some what similar to this but here i am making a reference
to Googles API which says that for " Flash and other Non-Javascript
Environments " use JSON ( javascript object notation ) and the sample
code snippet is also provided at : " 
http://code.google.com/apis/ajaxsearch/documentation/
".  SEE the code at last of this post

so why cant we invoke Google search service from JAVA ?, as Jgeerdes
as posted in one of the replies.

                                       // code snippet

URL url = new URL("http://ajax.googleapis.com/ajax/services/search/web?
v=1.0&q=Paris%20Hilton");
URLConnection connection = url.openConnection();
connection.addRequestProperty("Referer", "http://www.mysite.com/
index.html");

String line;
StringBuilder builder = new StringBuilder();
BufferedReader reader = new BufferedReader(new
InputStreamReader(connection.getInputStream()));
while((line = reader.readLine()) != null) {
 builder.append(line);
}

JSONObject json = new JSONObject(builder.toString());
// now have some fun with the results...

                      // code snippet ends here

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google AJAX API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-AJAX-Search-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to