facebook-php-sdk

CURL Get Request with a parameter that contains a GET url

孤人 提交于 2019-11-30 17:24:06
I'm trying to make a cURL GET to scrape a Facebook Graph object: GET https://graph.facebook.com/?id=**OBJECT_URL**&scrape=true&method=post In my case, OBJECT_URL contains GET parameters: https://www.example.com/og.php?a=b&c=d For that reason I can't have it as a GET parameter in file_get_contents() or CURLOPT_URL , as it'd turn out something like this: https://graph.facebook.com/?id=**https://www.example.com/og.php?a=b&c=d**&scrape=true&method=post Is there a way to pass it as a GET parameter in a way similar to CURLOPT_POSTFIELDS ? You need to escape your parameters, the http_build_query

Problem with Facebook login not matching CSRF state token

折月煮酒 提交于 2019-11-30 15:37:27
问题 I did some searches and I didn't find anything that was related to my problem. I'm currently trying to implement a Facebook login to my website and I'm having problems with the login authentication due to htaccess mod rewrite URLs? The code works perfectly and I get logged in if I use it without the mod rewrite rules like: domain.com/view_webhosting.php?webhosting=name But as soon as I go over to the mod rewrite URL domain.com/webhosting-name/ Then it just doesnt work and throws a error "CSRF

Problem with Facebook login not matching CSRF state token

你。 提交于 2019-11-30 15:17:41
I did some searches and I didn't find anything that was related to my problem. I'm currently trying to implement a Facebook login to my website and I'm having problems with the login authentication due to htaccess mod rewrite URLs? The code works perfectly and I get logged in if I use it without the mod rewrite rules like: domain.com/view_webhosting.php?webhosting=name But as soon as I go over to the mod rewrite URL domain.com/webhosting-name/ Then it just doesnt work and throws a error "CSRF state token does not match one provided." in the htaccess file it looks like this RewriteRule

Get list of Page Albums using Facebook PHP SDK v5

浪子不回头ぞ 提交于 2019-11-30 14:29:42
I want to use Facebook PHP SDK v5 to get a list of photo albums for a Page. I am following the instructions at https://developers.facebook.com/docs/graph-api/reference/v2.4/page/albums , which are as follows: /* PHP SDK v5.0.0 */ /* make the API call */ $request = new FacebookRequest( $session, 'GET', '/{page-id}/albums' ); $response = $request->execute(); $graphObject = $response->getGraphObject(); /* handle the result */ This does however seem to be incorrect as there is no " execute " function in the FacebookRequest class. In addition, there also needs to be the access_token passed as the

Facebook PHP API post to wall falls under “Recent Posts by Others”

淺唱寂寞╮ 提交于 2019-11-30 12:17:18
I want to post a message to the wall of a Facebook Page. I am the admin of the app and the page used in this code, I already gave permissions needed for my app to be able to post on my page, it works when I use only the field "message", like this: $message = array( 'message' => "Test2",<br> ); $result = $fb->api('/411895472189524/feed','POST',$message); The code above posts to my page wall and the post is made "from" the page itself, just like if I would do it manually from facebook. This is working great. But when I try to add more fields like "link" or "picture" or "description" the post

facebook graph api check if user is a member of a group using PHP

与世无争的帅哥 提交于 2019-11-30 10:10:31
i want to check if a user is a member of a group using facebook graph api... i have this: $group = file_get_contents("https://graph.facebook.com/177129325652421/members?access_token=XXXXXXXX"); $group = json_decode($group); $checkuser = $group->data; and check the user if is a member by using his facebook id and in_array() if(in_array($_GET["fid"],$checkuser)){ echo "yes"; } else { echo "no"; } can someone help me to correct this please... my code is not working... Reference: https://developers.facebook.com/docs/reference/api/ Use the API url: https://graph.facebook.com/me/groups To get a user

Is it possible to upload a photo to fanpage album without publishing it?

懵懂的女人 提交于 2019-11-30 07:45:12
问题 Here on my fanpage I've added my small app, that makes it possible, that fans can upload photos to a special photo album of this fanpage. It's possible, cuz I use a fanpage admin permission ("manage_pages, publish_stream and offline_access"). But now - everytime someone uses this app, I get a photo publish news feed on my fanpage. How can I add a photo to a fanpage WITHOUT publish it to the newsstream? Actually my publish php code looks like: <?php $post_data = array( 'image' => ('@' .

Error on Login using Facebook PHP SDK with Strict Mode Enabled

霸气de小男生 提交于 2019-11-30 07:13:35
I got a notification from Facebook saying that they will invalidate calls from URIs not listed in the Valid OAuth redirect URIs this coming March 2018 and I think they are requiring us to Enable Strict Mode for Redirect URIs. Link about this can be found here . I have been using their PHP SDK with Strict Mode disabled for a year now without any problem however when I do enable strict mode and place there the redirect url which is: https://nino-dot-dynamic-osprey-93721.appspot.com/admin/fb-callback_admin.php - it returns an error as seen below each time I try to Login with Facebook: Graph

Getting list of Facebook friends with latest API

爱⌒轻易说出口 提交于 2019-11-30 05:54:17
问题 I'm using the most recent version of the Facebook SDK (which lets to connect to something called the 'graph API' though I'm not sure). I've adapted Facebook's example code to let me connect to Facebook and that works... but I can't get a list of my friends. $friends = $facebook->api('friends.get'); This produces the error message: "Fatal error: Uncaught OAuthException: (#803) Some of the aliases you requested do not exist: friends.get thrown in /mycode/facebook.php on line 543" No clue why

How to login in website using facebook id

折月煮酒 提交于 2019-11-30 05:20:40
I have made a website on which a user has to log in using a username and password. I have seen these in so many website, we can connect through facebook account. And I want to add the same to my web site. How is it possible,using php sdk or the javascript sdk? The team at Facebook has spent considerable time documenting this, I would suggest you start there: http://developers.facebook.com/docs/guides/web#login http://developers.facebook.com/docs/authentication/ If possible, I would do like dracolytch writes here and create a level of abstraction for both OpenID and Facebook. He is willing to