【问题标题】:Facebook post to user's wallFacebook 发布到用户的墙上
【发布时间】:2012-12-30 21:08:16
【问题描述】:

任何有关如何制作内容的指南,当用户使用 Facebook 登录我的网站时,它会自动使用他们的 Facebook 帐户发布状态,例如“John 刚刚加入 mysite.com”,这样他们所有的朋友都会看到。有这样的吗?

【问题讨论】:

    标签: facebook api facebook-graph-api


    【解决方案1】:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title>Facebook post</title>
      </head>
      <body onload="publishWallPost('{{ page.slug }}')">
        <script>
        window.fbAsyncInit = function() {
            FB.init({appId: 'Your Super Cool App ID', status: true, cookie: true, xfbml: true});
                };
            (function() {
                var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
                document.getElementById('fb-root').appendChild(e);
            }());
        </script>
    
    
    
    
        <script>
        <!--
        function publishWallPost(slug) {
            var attachment = {'name':'My Super Cool Website','description':'This is a test of the Facebook Broadcast System.  If this was real, you would be reading something useful.','media':[{'type':'image','src':'http://MySuperCoolWebsite.com/images/facebook_image.png','href':'http://www.MySuperCoolWebsite.com/' + slug + '/'}]};
            FB.ui({
                method: 'stream.publish',
                message: 'I just found this Super Cool Website!',
                attachment: attachment,
                user_message_prompt: 'post this to your wall?'
            });
        }
        //-->
        </script>
      </body>
    </html>
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-14
    • 2012-01-05
    • 2011-07-15
    • 1970-01-01
    相关资源
    最近更新 更多