For acadmic purposes, I want to create a standalone app which can search and find web images with word keys.
URL url = new URL("https://ajax.googleapis.com/ajax/services/search/images?" +
"v=1.0&q=barack%20obama&userip=INSERT-USER-IP");
URLConnection connection = url.openConnection();
connection.addRequestProperty("Referer", /* Enter the URL of your site here */);
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());
I have the following questions, in base of this code:
1) Which library (jar file) should I use of JSON? (The page recomended in the Google example doesn't show libraries or jars)
2) If I'm writing a standalone application, what should I put in the /*Enter the URL of your site here*/ thing?
Thank you a lot :)