我需要得到“一个FB用户在帖子中标记的次数”。我进行了编码以获取基本编码,我的编码是:
FB.Event.subscribe('auth.authResponseChange', function(response) {
if (response.status === 'connected') {
testAPI();
} else if (response.status === 'not_authorized') {
FB.login();
} else {
FB.login();
} });
获取基本信息的代码是:
function testAPI() {
FB.api('/me', function(response) {
pInfo = document.getElementById("personalInfo");
name = "<strong>Your Name:</strong> "+response.name;
fName = "<br><strong>First Name:</strong> "+response.first_name;
lName = "<br><strong>Last Name:</strong> "+response.last_name;
pLink = "<br><strong>Profile Link:</strong> <a href='"+response.link+"' target='_blank'>"+response.link+"</a>";
gender = "<br><strong>Gender:</strong> "+response.gender;
verified = "<br><strong>Verified:</strong> "+response.verified;
pInfo .innerHTML += name+fName+lName+pLink+gender+verified;
});
FB.api('/me/friends', function(response) {
friendCount = "<br><strong>Friends Count:</strong> "+response.data.length;
pInfo = document.getElementById("personalInfo");
pInfo .innerHTML += friendCount;
}); }
就像我需要展示的那样:
在 Facebook 上的帖子中被标记的次数:(一些价值)