Reputation: 805
We are coding a facebook app that creates a post on people's Walls when they enter the competition. We're having a problem with the contents of the post that is being created.
The status message and link are functioning as intended however the picture, name, caption and description are instead being grabbed from the page that the post is linking to.
This is the code we're using to post to people's Walls:
$facebook->api("/me/feed", "post", array(
message => "I've just chosen my kangaroo to win a ticket to the Caravan, Camping and Off-Road Sale at the Adelaide Showgrounds (August 2-5). Be quick, there are only 1000 tickets up for grabs! Just click the link below.",
picture => "http://gmbo.com.au/hosted/cca/pak/app-icon.png",
link => "http://www.facebook.com/pages/WEIM-Sandbox-2/241942125896015?sk=app_416990981685156",
name => "CLICK HERE",
caption => "If you love caravans, camping or outdoor recreation - you'll love this Show.",
description => "If you love caravans, camping or outdoor recreation - you'll love this Show."
Any help would be hugely appreciated, this Facebook API stuff can be pretty frustrating.
Thanks
Upvotes: 1
Views: 403
Reputation: 805
There was nothing wrong with this code. You don't need the quotes.
This was a Facebook API bug. We tried what you mentioned, but there is a known bug about this. What we were trying to do is too ambitious for poor little Facebook to wrap it's tiny brain around.
Upvotes: -1
Reputation: 622
You are missing ' '
for each of the properties. Also, you forgot to close brackets.
$facebook->api("/me/feed", "post", array(
'message' => "I've just chosen my kangaroo to win a ticket to the Caravan, Camping and Off-Road Sale at the Adelaide Showgrounds (August 2-5). Be quick, there are only 1000 tickets up for grabs! Just click the link below.",
'picture' => "http://gmbo.com.au/hosted/cca/pak/app-icon.png",
'link' => "http://www.facebook.com/pages/WEIM-Sandbox-2/241942125896015?sk=app_416990981685156",
'name' => "CLICK HERE",
'caption' => "If you love caravans, camping or outdoor recreation - you'll love this Show.",
'description' => "If you love caravans, camping or outdoor recreation - you'll love this Show."
));
If it still doesn't work, check that you have allowed publish_stream
permission in your fbmain.php.
You can refer to PHP SDK and JavaScript SDK Feed Dialog for more examples.
Upvotes: 2