1

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

Mysophobe
  • 622
  • 2
  • 10
  • 33
3Dom
  • 795
  • 3
  • 10
  • 22
  • Are you still having problem posting message to timeline? Post your latest error/exception of this problem here so that we can help you better. – Mysophobe Jul 21 '12 at 03:28
  • I realized the picture `http://gmbo.com.au/hosted/cca/pak/app-icon.png` has been removed from its website host. You may want to upload your picture to a more lasting website like www.photobucket.com instead. – Mysophobe Jul 21 '12 at 03:32
  • Having the same issue, reported here http://developers.facebook.com/bugs/285673898207039 – Shane Jones Jul 25 '12 at 13:53

2 Answers2

2

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.

Community
  • 1
  • 1
Mysophobe
  • 622
  • 2
  • 10
  • 33
-1

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.

3Dom
  • 795
  • 3
  • 10
  • 22