开发者

possible to have a 'publish to facebook' button on my site?

I'm building a music events website and want to have a 'share this event' button which publishes the event details on facebook.

this tool looks like exactly what i want: http://developers.facebook.com/tools.php?connect_wizard&wizard=stream_publish

however, if i copy the code snippet to new file on my site, it doesn't work.

I'm assuming there's a few lines of extra php/js i need somewhere?

so far i have

<body>      
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<script开发者_JS百科 src="http://static.ak.connect.facebook.com/connect.php/en_GB" type="text/javascript"></script>
<script type="text/javascript">FB.init("89bb37189bede9e30eb07a66b9a1c52a");</script>
<script type="text/javascript">
    function callPublish(msg, attachment, action_link) {
      FB.ensureInit(function () {
        FB.Connect.streamPublish('', attachment, action_link);
      });
    }
</script>


The large hash value in the call to FB.init() has to be your API key. Set one up and you should be good to go.


I think the share widget is the simplest route to take: http://www.facebook.com/facebook-widgets/share.php. You can also use meta tags to help specify what's in the content of the share.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜