FB.api(
'/10154092833240172',
'GET',
{"fields":"reactions.type(LIKE).summary(total_count).limit(0).as(like),reactions.type(LOVE).summary(total_count).limit(0).as(love),reactions.type(WOW).summary(total_count).limit(0).as(wow),reactions.type(HAHA).summary(total_count).limit(0).as(haha),reactions.type(SAD).summary(total_count).limit(0).as(sad),reactions.type(ANGRY).summary(total_count).limit(0).as(angry)"},
function(response) {
// посмотрите, что приходит в ответе
console.log(response);
// затем используйте любимый способ для интерполяции данных и html
}
);
<meta property="fb:app_id" content="{YOUR_APP_ID}" />
<meta property="fb:admins" content="{YOUR_FACEBOOK_USER_ID}"/>
FB.ui(
{
method: 'feed',
name: 'This is the content of the "name" field.',
link: 'URL which you would like to share ',
picture: 'URL of the image which is going to appear as thumbnail image in share dialogbox',
caption: 'Caption like which appear as title of the dialog box',
description: 'Small description of the post',
message: ''
}
);
{
"name" : "post_reactions_by_type_total",
"period" : "lifetime",
"values" : [
{
"value" : {
"like" : NumberLong(1),
"love" : NumberLong(0),
"wow" : NumberLong(0),
"haha" : NumberLong(0),
"sorry" : NumberLong(0),
"anger" : NumberLong(0)
}
}
],
"title" : "Lifetime Total post Reactions by Type.",
"description" : "Lifetime: Total post reactions by type.",
"id" : "<post_id>/insights/post_reactions_by_type_total/lifetime"
}
curl \
-F "access_token=<user_photos_token>" \
-F "caption=This is an image file" \
-F 'source=@\"C:\picture.png\"' \
"https://graph.facebook.com/v2.8/me/photos"
$request = new FacebookRequest(
$session,
'GET',
'/10206059239425923_10211089063488381',
array(
'metadata' => '1'
)
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
$fbApi = new Facebook([
'app_id' => 'идентификатор приложения',
'app_secret' => 'секрет приложения'
]);
$post = [
'message' => 'текст сообщения',
];
$accessToken = new AccessToken('токен или маркер пользователя из фейсбука');
$fbApi->post(
'/идентификатор_группы_или_страницы/feed',
$post,
$accessToken
);