Publishing to the Wall

alviso - March 17, 2009 - 14:34
Project:Drupal for Facebook
Version:6.x-2.x-dev
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

Hi Dave,
publishing to the mini-feed with fb_feed_action works great. With the new changes on facebook it seems that these one-line stories don't get picked up to be displayed on the user's wall or friends' walls, meaning that they don't get noticed.
I know it is not strictly a DFF question but could be important to developers to know what to use to get stories up on the Wall? Do you have something implemented in DFF that could be used to do that.
Thanks,
Peter

#1

Dave Cohen - March 17, 2009 - 19:21

When facebook updated its API some months back, they made the news feed and wall essentially the same, from a developers perspective. You'll see most everything a person does on their profile wall, but only some of those things on your home page news feed. The algorithm for what's promoted is in facebook's hands. It depends on how good friends you are with the actor, whether the item involves you, whether you both have the application authorized, and who knows what else. So as far as we're concerned publishing to both is the same thing.

The actions in Drupal for Facebook use an API called publishUserAction. however in canvas pages and facebook connect pages, the preferred method is now showFeedDialog. I've added an api to use showFeedDialog, but have not integrated this with actions yet. (Actions are kind of a blunt instrument - its too difficult to control exactly when they fire, so I'm using PHP hooks to do this sort of thing now).

The modules provide a method fb_feed_show_dialog(). www.drupalforfacebook.org now uses this, so if you submit something to the test content forum you'll see what I mean. I'm behind on documenting fb_feed_show_dialog, and it's a little tricky to get all the parameters just right. I'll publish an example when I have some time.

#2

alviso - March 18, 2009 - 10:10

Thanks, appreciate the explanation, I'll be looking forward to an example of fb_feed_show_dialog().
Peter

#3

pribeh - April 6, 2009 - 23:32

BUMP.

#4

gemini - June 15, 2009 - 19:56

I looked into the modules code and it looks like the function feed_registerTemplateBundle is lacking $action_links array. It allows to add an action link to one line messages. Here is a direct link to the FB wiki.

#5

FrontBurner - September 3, 2009 - 18:54

Love this module, can't wait to see an example of fb_feed_show_dialog

#6

FrontBurner - September 3, 2009 - 21:23

Ok, so I decided to dig in and figure out how to call fb_feed_show_dialog manually. It is actually really easy. First parameter is the label of the template bundle you want to use, the second parameter i am leaving null as i do not know its use and the third parameter is just an associative array. Here is an example of it used in hook_comment:

function MODULE_NAME_comment(&$a1, $op)
{
if($op == 'insert')
{
$ar['user_message_prompt'] = 'Publish to facebook wall?';
$ar['user_message'] = $a1['comment'];
$ar['template_data']['title'] = $a1['subject'];
$ar['template_data']['author-name'] = $a1['author'];
fb_feed_show_dialog('add_product_review',null,$ar);
}
}

The array $ar['template_data'] must contain an associtive array with each index having the same name of each of your tokens that you want to use in your template bundles. If my example was using a token called {*url_alias*} then the array would need to define it
example: $ar['template_data']['url_alias']='some value';

#7

psi-borg - September 3, 2009 - 21:49

FB, thanks for your example... did you test it with tokens? for the audio.module (and assuming contributed modules in general) associated tokens didn't work with the feed content type.

Dave, for the create feed content type form you ask something like "what to do with this" about the body field. maybe the body can contain token data to override token data (or provide it when no associated tokens exist).

#8

Dave Cohen - September 4, 2009 - 09:39

Awesome FrontBurner, I appreciate the help.

The second parameter is $tokens. It's confusing because $ar['template_data'][$key] = $value get's the job done. But you can also pass in $tokens - in the bizarre data structure Drupal uses. So if you're using the token API, its easier to pass them in that way.

Use caution when adding too many tokens to the data structure. I've run into problems doing this on canvas pages. I think due to bugs in facebook's FBJS interpreter.

#9

craigmc - October 20, 2009 - 21:04

Dave--
What's the current status of fb_feed_action_show_dialog?

Craigmc

#10

totaldrupal - November 5, 2009 - 01:42

subscribing

#11

craigmc - November 12, 2009 - 19:45

FYI seems FB is changing the platform out from under us again, and will be restricting how apps can publish to the feed.

See this site for more info:
http://wiki.developers.facebook.com/index.php/Roadmap_Stream

#12

Dave Cohen - November 18, 2009 - 02:13
Version:5.x-2.x-dev» 6.x-2.x-dev
Status:active» duplicate

#447610: Open Stream API integration

Not planning to change anything in 5.x version. But patches welcome if anyone wants to back-port from 6.x version.

 
 

Drupal is a registered trademark of Dries Buytaert.