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

Posted by Haroldo on Stack Overflow See other posts from Stack Overflow or by Haroldo
Published on 2010-03-18T15:25:50Z Indexed on 2010/03/18 15:41 UTC
Read the original article Hit count: 505

Filed under:
|
|

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 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>


<input type="button" onclick="callPublish('',{'name':'jkhkjhkjh','href':'http://www.headfirstbristol.co.uk/','description':'jhfg jkdfgkjdfgjkdfkgdfg df gdg dfg dfg dfg dfg dfg dfg dfg','media':[{'type':'image','src':'http://www.headfirstbristol.co.uk/site_files/images/hf-logo.jpg','href':'http://www.headfirstbristol.co.uk/'}]},null);return false;" value="Preview Dialog" />

© Stack Overflow or respective owner

Related posts about facebook

Related posts about php