Using OpenGraph with PHP (cUrl requests for actions)

久未见 提交于 2019-12-03 07:30:57

Using the PHP SDK you would use the api method.

$config = array();
$config['appId'] = 'YOUR_APP_ID';
$config['secret'] = 'YOUR_APP_SECRET';

$facebook = new Facebook($config);
...
$facebook->api('https://graph.facebook.com/me/yellowheart:read?  
                article=http://example.com'','POST');

You could also do a raw request

$myurl = 'https://graph.facebook.com/me/yellowheart:read? 
          article=http://example.com&access_token=ACCESS_TOKEN&method=post';

$result = file_get_contents($myurl);
$facebook->api('/me/'.FB_NAME_SPACE.':action','POST',
   array('facility'=>'http://www.mysite.com/object?id=1')
                             );

https://developers.facebook.com/docs/reference/php/facebook-api/

Heidi Jermyn

I followed the tutorial "Recipe Box" and found out how to "make it happen" in there step by step. Hope that helps in some way.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!