this.proxyHost,
this.proxyPort);
}
protected FoursquareProfile extractUserProfile(String body) {
FoursquareProfile profile = new FoursquareProfile();
JsonNode json = JsonHelper.getFirstNode(body);
if (json == null) {
return profile;
}
JsonNode response = (JsonNode) JsonHelper.get(json, "response");
if (response == null) {
return profile;
}
JsonNode user = (JsonNode) JsonHelper.get(response, "user");
if (user != null) {
profile.setId(JsonHelper.get(user, "id"));
for (final String attribute : OAuthAttributesDefinitions.foursquareDefinition.getAllAttributes()) {
profile.addAttribute(attribute, JsonHelper.get(user, attribute));
}
}
return profile;
}