facebook-php-sdk

How could I determine which are the best friends of a Facebook application user?

坚强是说给别人听的谎言 提交于 2019-12-06 04:30:48
问题 I'm currently trying to create a Facebook application with the Facebook PHP SDK. I would like to retrieve which of the user's friends are his best friends, or the one he's most talking with. Do you know an algorithm or a tip to get them? 回答1: Simply, look for markers of friendship, give each activity a weight, total up the "friend score", and appropriate by the age of the friendship (if you're looking for a "lifetime" score). You could look at different timeframes, such as "recent best

JS SDK vs. PHP SDK

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 00:43:56
问题 From my brief exploration around various websites, it seems that the JS SDK is much more commonly used than the PHP SDK. Even sites that are implemented in PHP use the JS SDK. The PHP reference page has 776 likes, whereas the JS reference page has 20k+ likes. The PHP reference page says the PHP SDK helps you add Facebook Login to your page, but even the Login Button uses the JS SDK. Does the PHP SDK actually have any advantage at all? Why so little effort is being put into the PHP SDK? 回答1:

Access Facebook Session using PHP

谁都会走 提交于 2019-12-05 23:17:19
I am struggling to keep the Facebook session alive using PHP on my website. I use both the JavaScript SDK and the PHP SDK to form the basis of my app. The problem I am having is that when the "Facebook session" ends, my PHP script believes that you are logged out of Facebook. But, as soon as I call the FB.init() using the JavaScript SDK, the session comes back to life. Is there anyway to achieve the same using the PHP SDK? Or can I set a custom expiry time on the Facebook session? Extracted from comments It seems that the session expire time is set to 2 hours but I am not certain about this. I

Check if a Facebook user likes a page using fql

依然范特西╮ 提交于 2019-12-05 21:38:16
I want to check whether the loggedIn user has liked a specified page or not. Below is my code. $fql_pageid = "SELECT url,site,id FROM object_url WHERE url IN('http://developers.facebook.com/')"; $api_pageid = $facebook->api(array( 'method' => 'fql.query', 'query' => $fql_pageid )); $pageid = $api_pageid[0]["id"]; //get id of the specified page $fql_like = 'SELECT object_id FROM like WHERE user_id=me()'; $api_like = $facebook->api(array( 'method' => 'fql.query', 'query' => $fql_like )); When I do var_dump($api_like) , there are only 6 records appearing. But I checked my Facebook account, there

Hybridauth Authentication failed! Facebook returned an invalid user id

做~自己de王妃 提交于 2019-12-05 20:46:12
I'm using Hybridauth library to create a signup with facebook link in my website i created and tested the code in localhost and everything worked perfectly but when moved everything to the server it didn't work and gave me this error Authentication failed! Facebook returned an invalid user id i searched a lot on the internet for a solution but none of them worked I tried all solutions suggested in this links: Hybridauth - PHP - Facebook returned an invalid user id HybridAuth Facebook returned an invalid user id laravel4 hybridauth facebook Authentication failed! Facebook returned an invalid

facebook sdk php example not working

馋奶兔 提交于 2019-12-05 16:26:33
I am trying to develop facebook login for a website, i tried the example given with php-facebook-sdk even after login to facebook the $user variable is still 0 even after facebook login it is not showing logout url. call to $facebook->getUser(); function is allways returning 0. require '../src/facebook.php'; // Create our Application instance (replace this with your appId and secret). $facebook = new Facebook(array( 'appId' => 'xxx', 'secret' => 'xxxx', )); // Get User ID $user = $facebook->getUser(); // We may or may not have this data based on whether the user is logged in. // // If we have

creating event via facebook graph api

强颜欢笑 提交于 2019-12-05 11:56:44
Is there any way to create facebook event via code (as of today), referred to the documentation : for v2.0 for v1.0 Publishing was possible in v1.0 but not in v2.0. Is there legacy API support which I can use to create facebook events ? Any help appreciated. If your app is a Graph API v2.0 app (created after April 30th 2014), you don't have the possibility to create events anymore via the Graph API. If your app is v1.0, the possbility to create events will vanish on May 1st 2015. 来源: https://stackoverflow.com/questions/24778846/creating-event-via-facebook-graph-api

Facebook App - The domain of this URL isn't included in the app's domains. Why?

荒凉一梦 提交于 2019-12-05 11:09:27
When trying to login with a Facebook app, I'm getting the following error: Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings. As you can see on the following image: URL: http://www.facebook-php-test.com Below is the configuration I have set on my Facebook App. ( Notice: for privacy purposes I changed the values for App ID and App Secret on the image) The code for this basic sample application is on this GitHub repository: https://github.com/zeuscronos

Graph Batch API

╄→гoц情女王★ 提交于 2019-12-05 09:16:46
this is my first post at stackoverflow. I am using the Facebook Graph Batch API to request the Feed-Updates from several users at once. But I really don't know how the appropriate error handling is done. Following example should demonstrate my problem: Batch request: user1 - valid access_token user2 - invalid (password change maybe?) user3 - valid access_otken The answer from Facebook could look like this: successful answer unsuccessful answer (OAuth Exception) successful answer But reading the docs, it seems like that the ordering of the answer is not guaranteed. So my question is, how do I

Force links to open outside facebook's inapp browser

て烟熏妆下的殇ゞ 提交于 2019-12-05 09:10:00
Facebook updated it's mobile app and created an in-app browser and as they say it's more faster. The problem is that any link of any page opens inside this browser. I tried a lot of combinations without luck... Some examples are bellow. Did anyone knows more about it and how to forece links to open on external browsers? <script> function externalLinks() { for(var c = document.getElementsByTagName("a"), a = 0;a < c.length;a++) { var b = c[a]; b.getAttribute("href") && b.hostname !== location.hostname && (b.target = "_blank") } } ; </script> <a href="http://www.google.com" onClick="externalLinks