Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8494571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:20:11+00:00 2026-06-10T23:20:11+00:00

I want my site to have better fb integration than it currently does. As

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:20:12+00:00Added an answer on June 10, 2026 at 11:20 pm

    Example:

    Using php sdk 3.1.1 / in a batch query, other queries removed.

       $queries = array(
            array('method' => 'POST', 'relative_url' => '/me/anotherfeed:view?feed=http://anotherfeed.com/?fbid='.$thepage[id].'')
            // any other api calls needed, this is a batch request for performance.
       );
        try {
     $postResponseA = $facebook->api('?batch='.json_encode($queries), 'POST');
        } catch (FacebookApiException $e) {
      //echo 'AF error: '.$e.'';
      }
      $actions=json_decode($postResponseA[0][body], true);
    

    The post above is broken in to 4 part

    Namespace anotherfeed:

    Action view?

    Object feed

    URL http://anotherfeed.com/?fbid='.$thepage[id].'

    This produces “User Viewed Whatever Feed on Another Feed”


    The action depends on OG Meta tags in the head of the page to fill the action post.

    Example Tags:

    <meta property="og:title" content="SecurityNewsDaily" />    
    <meta property="og:description" content="SecurityNewsDaily on Another Feed, Feeding on the best of Facebook, one page at a time." />
    <meta property="og:type" content="anotherfeed:feed" />
    <meta property="og:image" content="https://graph.facebook.com/146893188679657/picture?type=large" />
    <meta property="og:site_name" content="AnotherFeed" />
    <meta property="fb:app_id" content="135669679827333" />
    <meta property="fb:admins" content="732484576" />
    <meta property="og:url" content="http://anotherfeed.com/index.php?fbid=146893188679657" />
    <meta property="og:restrictions:age" content="13+"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have site wide default settings for all jQuery validation uses on
I want to have my site urls look like http://example.com/place/info?var=info&morevars=ifneeded Place and info are
I have a site that i want to redirect all requests accept for 1
I have a site for which i want to show a image in india
I Have done a site but want to redirect it to another subdomain in
I have a site which I want to download using Unix wget . If
I have textarea in my site(link shortening site) i want to user enter some
I have a site running in django and want to make it available on
I have 2 site: example.com and exampletwo.com I want that when a user login
I am creating a site and want to have individual pages for each row

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.