I want my site to have better fb integration than it currently does. As of right now, I use the following code to post a message/link to a given user's timeline.
$attachment = array('message' => 'Predicted the '.ucwords($winning_team_short).' to beat the '.ucwords($losing_team_short).' on '.ordSuffix($new_date_format).'',
'caption' => 'Sportannica - Online Sports Encyclopedia',
'name' => 'How will your predictions pan out?',
'link' => 'http://www.sportannica.com/games/'.$league.'/'.$game.'/predictions',
'description' => ''.ucwords($winning_team_short).' ('.$winning_score.') '.ucwords($losing_team_short).' ('.$losing_score.')',
'picture' => 'http://www.sportannica.com'.$path.''.$winning_team.'.png'
);
$facebook->api('/me/feed/', 'post', $attachment);
I want a better method though... one that posts a message to a user's timeline much like the way an app like spotify does.
When I go to the open graph dashboard, I have defined several custom action and object. One action is to "predict". I want to make it so that the message reads "".$fb_user_name." has predicted the ".$winning_team." to beat the ".$losing_team." on ".$game_date."";
I'm relatively new to the fb api, so I'm a bit lost when it comes to this material. I do know that spotify's method uses custom actions so I know that I'm on the right path. Could anyone post some sample php code for their method of posting a message that utilizes custom actions and objects to a user's timeline?
Thanks,
Lance