如何以编程方式在我的Facebook时间轴上发布?

时间:2012-10-28 16:23:07

标签: javascript facebook facebook-timeline

我想在时间轴上发布一个故事。

如何做到这一点?

1 个答案:

答案 0 :(得分:2)

您需要做的就是阅读以下内容:

http://developers.facebook.com/docs/reference/javascript/

从上面开始:

以下示例使用FB.ui()方法调用Feed对话框,以允许用户发布指向其时间轴的链接:

FB.ui(
{
   method: 'feed',
   name: 'The Facebook SDK for Javascript',
   caption: 'Bringing Facebook to the desktop and mobile web',
   description: (
      'A small JavaScript library that allows you to harness ' +
      'the power of Facebook, bringing the user\'s identity, ' +
      'social graph and distribution power to your site.'
   ),
   link: 'https://developers.facebook.com/docs/reference/javascript/',
   picture: 'http://www.fbrell.com/public/f8.jpg'
},

function(response) 
{
    if (response && response.post_id) 
    {
      alert('Post was published.');
    } 
    else 
    {
      alert('Post was not published.');
    }
 }

);