Lucas Ferreira
Lucas Ferreira

Reputation: 888

How to auto share a post on facebook timeline?

I have a website that uses the Group Buying Site plugin (http://groupbuyingsite.com). It uses facebook app to login and register.

When I add a new item to the cart the user is redirected to cart.php and the function add_item($product_id, ...) is called. I want to know if there is a way that when I enter this page I automatically share a post on facebook timeline.

Thanks.

Upvotes: 0

Views: 6529

Answers (2)

user4766732
user4766732

Reputation: 1

$result = $facebook->api(
    '/me/feed/',
    'post',
    array('access_token' => $access_token, 'message' => 'Your Post here')

Upvotes: 0

William Buttlicker
William Buttlicker

Reputation: 6000

Assuming you have the access token, I suggest you try this:

$result = $facebook->api(
    '/me/feed/',
    'post',
    array('access_token' => $access_token, 'message' => 'Your Post here')
);

Upvotes: 2

Related Questions