facebook-javascript-sdk

How to get most liked, commented and shared posts from Facebook's API

三世轮回 提交于 2019-12-04 18:12:40
I'm trying to get some figures from Facebook telling me which posts have the most likes, comments and shares for a given Facebook page and within a given date range. I can get these figures if I query the API to get all the individual posts and loop through them in my own code, but I'm often getting an error from the API "600 calls per 600 seconds" rate limit error from them, because I'm making a call for each post. I've tried using FB's batch graph requests but this doesn't reduce the likelyhood of getting that error. Is there a way to do this so that I don't need to make so many calls? smalu

Extending valid/expired 60 days access token without user interaction

烈酒焚心 提交于 2019-12-04 17:59:10
I use access token in my joomla module to get page/group wall feed posts to show in user website page.user generated access token by my facebook application from my site before using the module in their joomla site. What i want - "I want to extend the expire date of an existing non-expired/expired 60 days token without user interaction". What i got from web that calling this url token can be extended - https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECRET&grant_type=fb_exchange_token&fb_exchange_token=EXISTING_ACCESS_TOKEN some test i did to extend token and

Is there a way to submit a “fake” form using jQuery?

允我心安 提交于 2019-12-04 17:16:12
What I want to do is make a POST request with arbitrary params, much like submitting a form. That is not merely doing the XHR . What I ideally want is to emulate a submit (like submiting a form, not POSTiing and then redirecting). I want to avoid the latency of $.post + window.top.location = blah The most direct way would be to have a 'fake' form and insert a bunch of elements, then serialize and use jQuery.submit(), something like Is there a way using jQuery to submit a form without the elaborate field by field breakdown? I wish there were a more elegant way. My use case is that I am

Facebook PHP SDK $uid = $facebook->getUser() always returns 0 [duplicate]

三世轮回 提交于 2019-12-04 17:14:55
This question already has answers here : Why is Facebook PHP SDK getUser always returning 0? (26 answers) Closed 5 years ago . I am trying to integrate our DB with the facebook API , really new on this so I would appreciate some help. I am always getting 0 Using $uid = $facebook->getUser() I had a look to similar issues but didn't find a related solution. PHP if($_REQUEST['action']=="signup" && $_REQUEST['auth']=="facebook" && !empty ($_REQUEST['auth']) && !empty ($_REQUEST['action']) ) { require_once('libs/facebook/src/facebook.php'); $config = array(); $config['appId'] = 'xxxx'; $config[

How to programmatically invite Facebook friends on a website

一个人想着一个人 提交于 2019-12-04 17:13:08
问题 The functionality that I need is to show a list of Facebook friends to the user on the website page with custom design, where the user can select some of them and send invites. In API v2.0 it's possible to get a list of friends this way: FB.api('/me/taggable_friends', function (response) { ... }); But it doesn't return real users' ID that I need for invites with the next function call: FB.ui({ method: 'apprequests', message: invite_text, to: 'user_id_1, user_id_2' }, function (response) { ...

How do I get back to the iPhone web app after having logged in with Facebook Connect?

我的未来我决定 提交于 2019-12-04 16:57:39
I have a mobile web site built using jQuery Mobile. I often run it in full screen/mobile web app mode on my iPhone (I have added the web app to my iPhone home screen). On one of the pages, the user is required to log in to Facebook using the Facebook Connect JavaScript API. If the user is not already logged in, this is done by clicking a login button. The event handler for this button looks like this: ("#fbLogin").click(function () { FB.login(handleStatusChange(response), { scope: "publish_stream", connect_display: "touch" }); }); In the above code I have inserted some line breaks for better

Access token warning when logging in using Facebook JavaScript SDK

倾然丶 夕夏残阳落幕 提交于 2019-12-04 16:51:14
问题 I'm using debug.js and getting the following message when executing FB.login : You are overriding current access token, that means some other app is expecting different access token and you will probably break things. Please consider passing access_token directly to API parameters instead of overriding the global settings. Any clues? 回答1: I solved the issue, the problem was that I was requesting a permission that the app was not approved for, and not using an FB account that was associated

Multiple fbAsyncInit's?

坚强是说给别人听的谎言 提交于 2019-12-04 15:12:44
问题 In my site I'm using asynchronous loading of the Facebook JS SDK. To actually set it up I use the standard FB.init inside of window.fbAsyncInit function. However the issue is that in my site this function is on every single page. However when I'm in a subpage I can't directly add to the JS function due to the design of my site, I have to copy and paste the whole function and add my bits. I don't think multiple fbAsyncInit's are possible, so whats the best way to implement this? 回答1: You can

FB.api pagination without nesting

橙三吉。 提交于 2019-12-04 14:52:44
I'm trying to generate a users entire friend list via Facebook's javascript API. I am able to get 50 (or so) of the users friends using the following call. FB.api("me/friends",function(response){ //Do something with response }); I know if the user has more friends I can get 50 (or so) more with the following code: FB.api("me/friends",function(response){ if (response.paging.next != "undefined"){ FB.api(response.paging.next,function(response){ } } }); This however is not ideal because in order to get an indeterminately long friend list I just need to nest a whole bunch of FB.api functions and

display photos from facebook with javascript api?

我们两清 提交于 2019-12-04 14:10:37
问题 I want to display photos from one of my facebook albums on my webpage with the javascript api. I can read the album names with the below code, but how can I then display the photos of one of the albums? FB.api('/myfacebookid/albums', function(response) { var ul = document.getElementById('albums'); for (var i=0, l=response.data.length; i<l; i++) { var album = response.data[i], li = document.createElement('li'), a = document.createElement('a'); a.innerHTML = album.name; a.href = album.link; li