Skip to content

zebastian/java-morguefile-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

java-morguefile-api

Java Class for accessing the API of morguefile.com

Example usage:

Morguefile mf_api = new Morguefile("YOUR_ID", "YOUR_SECRET");
String morgueResponse = mf_api.call("archive/search/new/1/cats", Morguefile.MF_API_JSON);

JsonParser jsonParser = new JsonParser();
JsonElement root = jsonParser.parse(morgueResponse);
JsonArray images = root.getAsJsonObject().get("response")
                    .getAsJsonObject().get("doc").getAsJsonArray();

for(int i = 0; i < images.size(); i++){
  String image_url = images.get(i).getAsJsonObject()
                      .get("Archive").getAsJsonObject()
                      .get("file_path_small").getAsString();
  System.out.println(image_url);
}

About

Java Class for accessing the API of morguefile.com

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages