Hi,

New to this. Maybe I am being a bit thick, but I want to call google,
get the results, I guess as a JSON Object, then lay them out in jsp in
my own page.  Never heard of JSON before but using teh google sample
code...

URL urlGoogle = new URL("http://ajax.googleapis.com/ajax/services/
search/web?v=1.0&q=Paris%20Hilton");
URLConnection connection = urlGoogle.openConnection();
connection.addRequestProperty("Referer", "http://www.mysite.com";);
String line;
StringBuffer sb = new StringBuffer();
BufferedReader reader = new BufferedReader(new
InputStreamReader(connection.getInputStream()));
while((line = reader.readLine()) != null) {
        sb.append(line);
        logger.debug(line);
}
JSONObject json = new JSONObject(sb.toString());

I get the object - but is there any sample code I can copy to parse
the JSON object and write out the results in my jsp?  I couldn't find
any really obvious examples anywhere.

It's the "have fun with JSON object" bit that I wanted a sample of so
I can integrate this quickly.  Am I missing the point or something?

Thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" group.
To post to this group, send email to Google-AJAX-Search-API@googlegroups.com
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