通过 api (me/links) 共享链接不使用提供的图片、标题和描述
我试图通过 /me/links 共享链接,而“me”被验证为 Facebook 页面。文档说,我可以为它提供“图片”、“标题”和“描述”,但这似乎不起作用,因为 facebook 尝试从页面接收该信息,例如 opengraph 标签等。
即使该网站不这样做不提供任何信息,Facebook 不使用此处。值得一提的是:Facebook 的普通链接共享功能本身也以同样的方式运行得很糟糕(这就是为什么我希望这是一个错误)。
代码非常简单:
<?php
$data = array(
'message' => $text,
'picture' => $pic,
'name' => $name,
'link' => $link,
'caption' => $caption,
'description' => $description
);
$result = $fb->api('/me/links','POST',$data);
?>
如果我在 /me/feed 上执行非常相同,facebook 不会忽略这些字段,一切看起来都很好,但它不会在用户提要中显示帖子(自九月份的最新更改以来),这是毫无价值的,并且它没有在帖子底部提供共享链接。
如果这是一个错误或意图,您有什么想法吗?我使用的是 PHP SDK 3.0.1。
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 worthless 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是设计使然。
当您将链接发布到 /me/links 时,流故事会从提供的 URL 中的 OG 标签获取数据。
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.
您发布的链接上的 HTML 应该如下所示:
@Simon - 这仍然没有回答“标题”属性来自何处的问题......
here's what the HTML on the link you post should look like:
@Simon - this still doesnt answer the question of where the "caption" property comes from...