当我从 Facebook 图表执行 get 时,我得到了一个复杂的字符串。
有没有办法将其分解为“图形用户”?
例如:
{"data":[{"id":"112221111"},{"id":"112221111"},{"id":"112221111"},{"score":{"data":[{"score":77777,"user":{"id":"5551","name":"כr"},"application":{"id":"3463464363636336","namespace":"tomatosmasher","name":"Tomato Smasher"}]},"id":"667677577575","installed":true},{"id":"55555555"},{"id":"55555555"},{"id":"55555555"},{"id":"55555555"},{"id":"55555555"},{"id":"55555555"},{"id":"55555555"},{"id":"55555555"},
我正在使用的代码
String currentUserFBID = user.getId();
String currentUserAccessToken = Session.getActiveSession().getAccessToken();
// Execute the HTTP Get to our server for the scores of the user's friends
HttpClient client = new DefaultHttpClient();
String getURL = "https://graph.facebook.com/" + currentUserFBID + "/friends?access_token=" + currentUserAccessToken + "&fields=installed,score";
HttpGet get = new HttpGet(getURL);
HttpResponse responseGet = client.execute(get);
// Parse the response
HttpEntity responseEntity = responseGet.getEntity();
String response = EntityUtils.toString(responseEntity);
谢谢你。