在我的网站上发布Facebook活动源插件

时间:2011-06-20 06:09:55

标签: javascript facebook

我在我的网站上使用过face book最近的活动脚本,但它没有在放置脚本的方框中显示任何内容,即使我有来自我朋友列表的提要。

以下是我使用过的代码:

<iframe src="http://www.facebook.com/plugins/activity.php?site=http%3A%2F%2Fintegration.mytaste.com.au%2F&amp;width=300&amp;height=300&amp;header=true&amp;colorscheme=light&amp;font&amp;border_color&amp;recommendations=false" 
    scrolling="no" 
    frameborder="0" 
    style="border:none; overflow:hidden; width:300px; height:300px;" 
    allowTransparency="true">
</iframe>

你可以从这里自己测试

http://developers.facebook.com/docs/reference/plugins/activity/

在框中使用此网址http://integration.mytaste.com.au/作为域名。

1 个答案:

答案 0 :(得分:2)

您网站上的任何网页上都没有任何Open Graph标记。查看Open Graph Protocol documentation并在页面中添加至少og:title,og:type,og:url和og:image元标记,以便让它们开始显示在Activity Feed plugin中。您可以使用URL Linter确保我们正确地抓取您的网页。

P.S。当用户单击“赞”按钮时自动发布到用户的墙上有点误导,可以由我们的政策团队调出(查看policies)。我建议您只使用Like Button。即使用户未登录到您的站点,它还具有提供社交上下文的额外好处。如果您需要检测用户何时喜欢您网站上的内容,您可以使用Javascript SDK中的FB.Event.subscribe订阅“edge.create”事件。