Sharing links via api (me/links) doesn't use provided picture,caption and description
I'm trying to share links via /me/links, while "me" is authenticated as a facebook page. The documentation says, I can provide it with "picture", "caption" and "description", but that doesn't seem to work, since facebook tries to receive that information from the page e.g. opengraph tags etc.
Even if the site doesn't provide any info, facebook doesn't use the fields that are documentet here. And to have it mentioned: The plain link sharing function at facebook itself works crappy in the very same way (that's why I'm hoping it's a bug).
The Code is very simple:
<?php
$data = array(
'message' => $text,
'picture' => $pic,
'name' => $name,
'link' => $link,
'caption' => $caption,
'description' => $description
);
$result = $fb->api('/me/links','POST',$data);
?>
If I do the very same over /me/feed, facebook doesn't ignore the fields and everything looks fine, but it doesn't show the post in a users feed (since the most recent changes in september), which is wor开发者_Go百科thless and it doesn't provide a share link at the bottom of the post.
Any ideas if this is a bug or intention? I'm using the PHP SDK 3.0.1.
This is by design.
When you post a link to /me/links, the stream story takes it's data from the OG tags in the URL supplied.
here's what the HTML on the link you post should look like:
<head>
<meta property="og:locale" content="en_US" />
<meta property="og:site_name" content="name for ENTIRE SITE"/>
<meta property="og:title" content="name of PAGE"/>
<meta property="og:type" content="website"/>
<meta property="og:image" content="<URL HERE>"/>
<meta property="og:description" content="my description" />
<title>Untitled</title>
</head>
@Simon - this still doesnt answer the question of where the "caption" property comes from...
精彩评论