I'm trying to accomplish this but without any luck. I want the possibility to publish a teaser of every new node to the facebook application wall associated with this module. Like the twitter plugin but with the facebook app.

Comments

Ryan Palmer’s picture

Category: feature » support
Status: Active » Fixed

Take a look at the Stream.publish() method:

http://wiki.developers.facebook.com/index.php/Stream.publish

It's also available in Javascript flavour as FB.Connect.streamPublish() if you want end-users to publish to their own walls and thus be prompted for authorization if necessary. Example:

  drupal_add_js("
    $(document).ready(function() {
      FB.Bootstrap.requireFeatures(['Connect'], function() {
        var attachment = {
          'description': '". $description ."',
          'name': '". $name ."',
          'href': '". $href ."',
          'media': [{'type':'image',
            'src':'". $src ."',
            'href':'". $href ."'}]
        };
      });
      FB.Connect.streamPublish('', attachment, null, null, '". t('Add your own comment') ."');
    });", 'inline', 'footer');

Where $description, $name, etc are set somewhere further up the script. Of course, this would have to go somewhere intelligent, ie. hook_nodeapi() when $op == 'insert' or something.

summit’s picture

Version: 6.x-1.0-beta9 »
Status: Fixed » Active

Hi,
I set this to active because of the remark in http://drupal.org/node/778314#comment-2896516 and I do not understand above code, sorry. Sorry also if I incorrectly set this to active again in your perspective.

Can I with current fbconnect module dev code post nodes or links to nodes on my facebook userpage?
(I am in search of exactly the same functionality as the "post to twitter" from the twitter module, but then for facebook).

Thanks a lot in advance for your reply!
Greetings, Martijn

1kenthomas’s picture

Any progress here? Subscribing.