4

我最近将我的代码从 https://graph.facebook.com/[profile_id]/feed 切换到 https://graph.facebook.com/[profile_id]/links

现在我遇到了这个问题,有人可以帮忙吗?- 我在帖子中附带的图片没有显示,看起来 facebook 默认使用它在链接页面上找到的第一张图片

http://developers.facebook.com/docs/reference/api/post/ http://developers.facebook.com/docs/reference/api/link/

这两个文件都允许我指定图片,但不知何故,“链接”没有显示图像。

提前致谢

4

3 回答 3

1

设置正确的 Open Graph 元标记,尤其是 og:image。

于 2012-06-08T14:06:07.107 回答
0

关于在我的 Android 应用上分享我正在使用此代码:

Bundle postParams = new Bundle();
postParams.putString("message", "User's custom message above share content");
postParams.putString("name", "The name of the link attachment.");
postParams.putString("description", "The description of the link (appears beneath the link caption). If not specified, this field is automatically populated by information scraped from the link, typically the title of the page.");
postParams.putString("caption","The caption of the link (appears beneath the link name). If not specified, this field is automatically populated with the URL of the link.");
postParams.putString("picture","The URL of a picture attached to this post. The picture must be at least 200px by 200px. See our documentation on sharing best practices for more information on sizes.");
postParams.putString("link", "The link attached to this post");    

详细参考文档:https ://developers.facebook.com/docs/sharing/reference/feed-dialog/v2.3

于 2015-03-30T05:51:06.030 回答
0

我刚刚解决了类似的问题,在网站上发布了新闻并通过 /links 发布到 fanpage,在帖子中解决了错误的图像内容和“找不到网站”标题。

该问题与错误的代码序列有关。我们在不太好的地方通过 fb api 发布新闻。该帖子应该已经可用,但它不是并且发布到 fb api 会导致 facebookexternalhit 机器人立即请求检查它是否存在。详细的日志分析表明,来自 facebook 的 ping 是在 POST 添加新闻之前完成的,这就是我们在那里弄乱内容的原因。

我们发布的示例内容,如果我上面描述的不是你的情况: content_dict = {

'图片': ' http://www.czerwonysmok.pl/static/media/uploads/blog/pb_reddragon_all2_poprawiony_czerwony.jpg/ ',

'message': '标题\n\n contentcontentcontentcontentcontentcontentcontent',

'链接':' http://www.czerwony-smok.pl/klub/aktualnosci/rashguard-ze-strony/ '}

try:
    logger.info("Publishing to facebook: " + str(content_dict))
    graph.post(path="%s/links" % settings.FAN_PAGE_ID, **content_dict)
于 2014-05-14T09:34:43.247 回答