1

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

4

1 回答 1

0
<!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>
于 2012-12-30T21:18:59.233 回答