How to Determine the Number of Followers on Facebook php - facebook

Facebook enables you to have both friends and followers on the network. Friendship is a two-way relationship -- you can see the updates of your friends, and they can see yours (depending on the privacy settings configured for each post). If you follow someone, this is a one-way relationship: You can see the user's public updates, but that individual doesn't see yours.
i have my own id where new people add me as friend but i on follow option. so new user follow me.is there any way i can get followed number in php.

very thank for luschn helping me
well i found its solution it was very easy hence Facebook doc / FQl not supported this function but getting number of followers is very easy
just
https://developers.facebook.com/docs/plugins/follow-button
my recommendation visit above line mention code is for sample only
Your Plugin Code
Include the JavaScript SDK on your page once, ideally right after the opening tag.
(function(d, s, id) { var js, fjs =
d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js
= d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5";
fjs.parentNode.insertBefore(js, fjs); }(document, 'script',
'facebook-jssdk'));
Place the code for your plugin wherever you want the plugin to appear on your page.
your
profile id place here(you can view this click on your profile copy
url) "
data-layout="standard" data-show-faces="true">

Related

Validating a facebook posting

I am trying to figure out if I can give somebody a "sharer" link where they click on it and then make a post to facebook. After they have posted, I wish to be able to verify that this post has not been tampered with or at the very least deleted, lets say 2 weeks from the time it was posted. Is there a way to programaticaly check if the post still exists and get the content of that post?
I know I can do the first part with some javascript such as this:
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/etc...";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
However, is there a way for me to check that what this user has posted still exists after 2 weeks?
This would only be possible by authorizing a user with the publish_actions permission. After that, posting something with the FB.ui dialog will return the post ID in the callback function. Of course you could also use /me/feed to post something then.
But authorizing a user just for this is pointless, it is not allowed to "incentivize" sharing, as you can read in the platform policy. So you are not allowed to reward the user for sharing in any way. Users need to share something because they really want to.
Also, you would never get through Login Review with this, so it´s actually impossible.

xxx shared a link via Widget Share Log App

I've created a Facebook App and am using the FB developer tools to share content on a site.
However, when a link is shared it is titled "xxx shared a link via Widget Share Log App". I've seen other sites change this to read something like "xxx shared a link via Irrawaddynews" and I wondered if it was possible to do the same here.
BTW, I'm initiating the Facebook SDK with the code below (as per the instructions here: "shared a link via Widget Share Log App." - but this didn't solve my problem).
window.fbAsyncInit = function() {
FB.init({
appId : '{MY_APP_ID}',
status : true,
xfbml : true
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
In your App ID settings on Facebook, there are a few fields you have to update. We wrote pretty detailed setup instructions for doing this in conjunction with our own share software, but there's a general section beneath that for setting up the Facebook app:
https://naytev.zendesk.com/hc/en-us/articles/202777178-Link-Naytev-to-Your-Facebook-App
#userfuser - you actually don't need their validation, you simply need to make the app active. The process has a pretty terrible UX, and missing fields like "support email" will cause you to not be able to activate without a helpful error message.

how to fix fabook js like code so it accesses facebook with either http or https

On my website http://stokesabode.com I have installed the Facebook Js like code using async. Although it appears to be working correctly Google page speed testing reports I should
Serve resources from a consistent URL
along with the resulting error that I am accessing facebook using both non secure and secure http.
I am using the Facebook code generator that provided:
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.async=true;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=my application id number";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
In testing I found that if I remove either:
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=my application id number";
or
(document, 'script', 'facebook-jssdk')
and rerunning the test the error would disappear and my page speed score will jump up. How can I fix this error so I am only accessing facebook in secure https mode?

Facebook like button error Message

I added a facebook like button in my page. The page is rendered by using AJAX.
Here is my code:
$(document).ready(function(){
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
});
When I access this page via Chrome, Chrome keeps log the error message:
Blocked a frame with origin "https://www.facebook.com" from accessing a frame with origin "site url" The frame requesting access set "document.domain" to "facebook.com", but the frame being accessed did not. Both must set "document.domain" to the same.
Thanks a lot for your help.
I just found this on the facebook developer site:
"This is a warning in Chrome that has no ill side effects
Please check whether you have any extensions installed."
http://developers.facebook.com/bugs/586120791417551/
It may be that you have a content script from an extension that is generating these errors. My site is slo showing several of these errors in the console log. However, the facebook button is operating correctly. I am going to test in a chrome session with no extensions installed.
Is your facebook like button functioning correctly (other than throwing messy console errors)?

How to get an ACCESS_TOKEN from the new Add to Timeline Auth dialog

I currently have the following situation. On my website, the user can access his settings page. This page features a tab called 'Facebook'. On this page, I have the following code that lets the user allow my website to post to his timeline when completing a certain action:
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#appId={APP_ID_HERE}&xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-add-to-timeline" data-show-faces="false" data-mode="button"></div>
When the user clicks the button, it is forwarded to the Add to Timeline dialog. When the user clicks Allow, the user gets redirected back to his settings page on my website.
The question is; how do I get an access token out of this? I need a user access token to post to his timeline, according to this line from the tutorial:
https://graph.facebook.com/me/YOUR_NAMESPACE:cook?recipe=OBJECT_URL&access_token=ACCESS_TOKEN
Just tell user to get log in
<fb:login></fb:login>
and after that, use this code everywhere you want
FB.api(
'/me/NAMESPACE:cook','post', {recipe:'http://samples.ogp.me/214706465259448'},
function(response) {
//posted
});
Where cooking is an object