Skip to content

Instantly share code, notes, and snippets.

@casidiablo
Created April 30, 2012 17:36
Show Gist options
  • Save casidiablo/2560334 to your computer and use it in GitHub Desktop.
Save casidiablo/2560334 to your computer and use it in GitHub Desktop.
try {
JSONObject jsonObject = new JSONObject("{\"pop_up\":{\"message\":\"Download a FREE game!\",\"conversion_id\":\"4f9ecd02b23e5a00080000fa\",\"bid\":22,\"links\":[{\"rel\":\"clicks\",\"href\":\"https://www.revmob.com/api/v4/conversions/4f9ecd02b23e5a00080000fa/clicks.json\"}]}}");
JSONObject popUp = jsonObject.getJSONObject("pop_up");
JSONArray links = popUp.getJSONArray("links");
JSONObject firstLink = links.getJSONObject(0);
String href = firstLink.getString("href");
System.out.println("::::: PROFIT! "+href);
} catch (JSONException e) {
e.printStackTrace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment