Arthur Flower
Arthur Flower

Reputation: 335

facebook php sdk and open graph user generated photos

This is more a matter of syntax, can anyone help me converting this raw call on a proper $facebook->api call?

What really confuses me is the nested array of images. Also I have to encode the "recipe object" because I have to add some parameters to it.

https://graph.facebook.com/me/nyccookbook:cook?
  recipe=http://www.yourdomain.com/pizza.html&
  image[0][url]=http://www.yourdomain.com/images/my_camera_pizza_pic.jpg&
  image[0][user_generated]=true&
  image[1][url]=http://www.yourdomain.com/images/my_camera_soda_pic_2.jpg&
  image[1][user_generated]=true&
  access_token=YOUR_ACCESS_TOKEN

Any help is really appreciated!

Alfonso

Upvotes: 0

Views: 642

Answers (1)

Anatejms
Anatejms

Reputation: 51

$options = Array(
    'recipe' => 'http://www.yourdomain.com/pizza.html',
    'image[0][url]' => 'http://www.yourdomain.com/images/my_camera_pizza_pic.jpg',
    'image[0][user_generated]' => true,
    'image[1][url]' => 'http://www.yourdomain.com/images/my_camera_soda_pic_2.jpg',
    'image[1][user_generated]' => true,
);

$wallPost = $this->fb->api('/me/nyccookbook:cook', 'post', $options);

Simple :)

$this->fb is facebook object

:edit: about recipe object this is only url to page with meta set to open graph object so all extra parameters you can set inside that page

see: http://developers.facebook.com/docs/opengraph/tutorial/#publish

Upvotes: 1

Related Questions