facebook-php-sdk

Retrieve data of a facebook page with graph API

↘锁芯ラ 提交于 2020-01-26 02:19:27
问题 I used (in 2012) to code with FQL and I was able to make some features such as FQL query to fetch all data of a facebook page Actually, FB migrate to graph API. My question is : Is it possible to retrieve public data of a page (or person) with graph API, even if I'm not a fan of that page (or not a friend ) 回答1: Yes, everything that you want to do is quite possible with the Graph API. Unless the Page / Group is private, then you will be able to fetch their public data without having to like

Facebook PHP SDK v4 Redirect when already logged

蓝咒 提交于 2020-01-25 10:25:07
问题 Is there a way to get the session when the user is already logged in? I can only do $session = $this->facebook->getSessionFromRedirect(); but I don't want the user to click the login link again. Instead, when the user is already logged I just want to redirect and get the session to use $request = new Facebook\FacebookRequest($session, 'GET', 'url'); I've tried this $session = new FacebookSession($_SESSION['FBRLH_state']); but I get an error Invalid OAuth access token. 回答1: What you need to do

Facebook PHP SDK: Unknown SSL protocol error

我与影子孤独终老i 提交于 2020-01-24 21:51:12
问题 I have a PHP script who make "get" requests to the Facebook API Graph with the Facebook SDK for PHP . For a few days, my script fails (50% of the time, or more), I've got this error: Unknown SSL protocol error in connection to graph.facebook.com:443 and I don't know why because: I didn't modify the script. I didn't change anything on the server. Moreover, my script runs on 2 servers and the problem occurs on both. Here are the details: #0 /var/www/oie/vendor/facebook/php-sdk-v4/src/Facebook

tag facebook friends python sdk GraphApi in put_photo

孤人 提交于 2020-01-21 10:30:40
问题 I would to post pictures and tag with frieds. graph = facebook.GraphAPI(self.cfg['access_token']) tags = [{"tag_uid": "1234567890", "x": 0, "y": 0}, {"tag_uid": "0001234567890", "x": 0, "y": 0}] graph.put_photo(image=open(str(file), 'rb'), message='Pictures test', **{'tags': tags}) but i've this error facebook.GraphAPIError: (#100) param tags must be an array. 回答1: error solved with tags = [{"tag_uid": "1234567890", "x": 0, "y": 0}] graph.put_photo(image=open(str(file), 'rb'), message=

Reload fb:comments widget

北战南征 提交于 2020-01-21 08:27:09
问题 I have a Facebook App that allows people to create "Posters". Every "Poster" can be commented on using fb:comments widget. User can switch between posters using AJAX. The problem is that after switching to next poster fb:comments widget is still pointing to previous URL. Is there a way to "reload" a widget for a new url? 回答1: Ok, solved this by myself, leaving it here for reference. If you want to reload fb:comments widget it's as simple as that: // xid can only contain a-zA-Z0-9_%.- comments

Reload fb:comments widget

ぃ、小莉子 提交于 2020-01-21 08:26:05
问题 I have a Facebook App that allows people to create "Posters". Every "Poster" can be commented on using fb:comments widget. User can switch between posters using AJAX. The problem is that after switching to next poster fb:comments widget is still pointing to previous URL. Is there a way to "reload" a widget for a new url? 回答1: Ok, solved this by myself, leaving it here for reference. If you want to reload fb:comments widget it's as simple as that: // xid can only contain a-zA-Z0-9_%.- comments

Can't request Facebook Login API permission “publish_actions” even for primary administrator

限于喜欢 提交于 2020-01-17 05:12:33
问题 I'm implementing Facebook login with an extended permission publish_actions using PHP SDK. It shows a message in the login dialog even if I signed in with my primary administrator account: Submit for Login Review. Some of the permissions below have not been approved for use by Facebook I have the following code snippet to post to the user timeline. try { $response = (new FacebookRequest( $session, 'POST', '/me/feed', array( 'message' => 'This is test post.' ) ))->execute()->getGraphObject();

Unable to echo dynamic data in facebook metatags

ぐ巨炮叔叔 提交于 2020-01-17 04:58:06
问题 I've successfully added facebook's social plugin to my news page (which itself dynamically creates all the article pages which appear under it). I've added metatags however cannot understand how to echo dynamic data within the metatags, especially since that data is generated later in the code. ie. My fb metatags are within the head of my news.php <head> ... *(other stuff)* <meta property="og:title" content="When Great Minds Go To Sleep" /> </head> However it doesn't make sense for me to

Facebook graph API Insights requests limit

◇◆丶佛笑我妖孽 提交于 2020-01-17 02:27:15
问题 I have an app which manages hundreds of Facebook pages. Now I need to make a dashboard which will show reports based on Facebook insights for every page but when I try to get the data from Facebook I am getting a message saying that I am reaching the requests limit and I am not able to make requests to Facebook Insights any more. For every page I get 10-15 metrics in a single request, but I have hundreds of pages. I found that the limit is 200 App request per hour, but for insights there are

How to update the profile cover photo using Graph API?

泄露秘密 提交于 2020-01-17 00:40:52
问题 There is an API support to update the cover photos for pages. Can I change my timeline cover photo using Facebook Graph API? There is a similar question in stack overflow click here. I have tried every solution in this question but I an unable to change the cover photo. I have used the method to update the page cover photo click here to see the documentation and this is the error Fatal error: Uncaught OAuthException: (#10) Application does not have permission for this action 回答1: After recent