JSONArray posts = json.getJSONArray("posts");
for (int i = 0; i < posts.length(); i++) {
JSONObject post = (JSONObject) posts.get(i);
String theUrl = post.getString("url");
if (theUrl.contains("imgur.com/a/")) {
ImgurAlbum album = null;
try {
album = ImgurRipper.getImgurAlbum(new URL(theUrl));
} catch (IOException e) {
logger.error("Error loading imgur album " + theUrl, e);
sendUpdate(STATUS.DOWNLOAD_ERRORED, "Can't download " + theUrl + " : " + e.getMessage());