Facebook Like Count - php

I've successfully integrated a Facebook Like button to WordPress based website. The Facebook Like button is shown only on single posts. However, I would like to output how many times a post is being liked on the front page of my site without showing the actual like button. A simple number output is what I'm after.
I've been reading Facebook documentation as well some tutorials that partly deal with this issue, but haven't got anywhere so far.

Paste this function in your theme functions.php file and save the file.
function bfan() {
$pageID = 'Page ID/Page Vanity URL';
$info = json_decode(file_get_contents('http://graph.facebook.com/' . $pageID));
echo $info->likes;
}
Then you can call the function.
You will need to know your facebook page ID or facebook page name,then just substitute it in the code above.
Hope this helps you out.

Facebook has an API for finding out how many Facebook shares (likes etc.) a page has:
http://graph.facebook.com/?ids=https://stackoverflow.com/

I found here a simple and great solution: link

If you want see the evolution of your Top Social Stories in your Wordpress, you can use this plugin that tracks data from Facebook, Twitter and Google+ for each post and globally for all the links of your blog and export these data also in custom field to use them in your theme.
UPDATE: this plugin now tracks also Pinterest, Linkedin and Vkontakte and has many new features.

Related

Is there any Custom facebook script for personal website?

I am working on website like facebook. In which i need to post video, images and post status and there is like,comment option for all posts same like facebook. So my question is there any custom script opensource so i can implement into my website.I did some googling but doesn't get any script like that.If any one knows about this script then please let me know.
Wordpress + Buddypress plugin could be a solution.
Obviously, nothing is going to have the exact Facebook functionality off the shelf.
You can use jomsocial for create this type of site. but no one script find which bind your all requirement about create this type of website

Import Facebook posts and not just embed them

I am looking at importing Facebook posts and not just embedding a Facebook iframe in the page. I want to be able to get the SEO benefits of having my website news page updated all the time by my Facebook page and I believe if I just use the Facebook embed code this wont work to improve it ?. Does anyone know of a tutorial or plugin for importing posts / pics into a php based website ?.
Thanks
Iain :-)
For this you may want to look at their graph api, https://developers.facebook.com/docs/reference/api/post/
https://developers.facebook.com/blog/post/490/
you need to authenticate to facebook and retrieve the post using the api
or you can use their plugin to display the fanpage posts on your website, it's much simpler.
Social2blog ( http://www.social2blog.com/ ) import facebook posts in your blog, with a creation of Wordpress post and then with real SEO benefits. Furthermore Social2blog permit to decide if you want to point the canonical url to Facebook post. The problem with Social2blog is that it works only with facebook page. Otherwise you can create your own php script, please refer to:
How to pull in Facebook Page posts as blog posts to WordPress?

how to grab content from google plus business page?

friends,
how we can grab posts and comments from gplus business page ?
My page link look like https://plus.google.com/b/xxxxxxxxx/ .
I got the api to get details from an account using the following method.
https://www.googleapis.com/plus/v1/people/108189587050871927619/activities/public?key=yourAPIKey
but i couldnt find any thing for business page.
am using php for developing the code.
Thanks in advance..
A page is a "user" like any other - grab the ID displayed in the URL when you're browsing the page's posts, and look up the public posts for that id.

What's up with Facebook Pages why is there fragmentation

I'm trying to figure out why Facebook is creating fragmentation with its pages. I really don't understand it. Also is there anything that can be done about this.
Here is a perfect example I have my Facebook company page for "Scoreoid" (http://www.facebook.com/pages/Scoreoid/245182948843019) this has my content wall post's, photos ect..
Then I have this page which I guess is only connected to the Scoreoid website which is new and was automatically done http://www.facebook.com/pages/Scoreoid-the-ultimate-game-platform-for-developers/269861406410210
This is the page for the Scoreoid site which has 130 likes but of course on Facebook it only shows 15 another question either way why is there two pages why can't everything be connected to one page.
All this does is create fragmentation which is noting but bad user experiences.
It would max sense to have everything directed to the Facebook main page. Of course I have other questions for which do I run advertising on which should I update with content?
I've already answered you here two weeks ago:
Facebook Likes not showing on Facebook page but show up on site
Facebook pages like counts are NOT THE SAME as like counts for a web site. They cannot be joined by Facebook as they are two separate IDs. You can have your parsing scripts add together the two like counts yourself.
This has been my experience. If you add the open graph meta tags (og:url, og:image, og:type, etc.) Facebook will create a "facebook page", but this page will only be accessable by you. This is the message that facebook will show on this open graph page: http://snag.gy/z9UfG.jpg
If besides this you create another page then it will not be linked with this page. I recommend you use the page you created as that page is accessible by everyone.
If this is not your case then please clarify.

Facebook share button for website

i need to use share button in my website. Different share button for different products.. mostly we need to use like this,
http://www.facebook.com/sharer.php?
In the above url what are all the parameters we need to pass for showing it as our website, product and some image of that product in that share page...
You asked what parameters you need to pass it to have it show up as your site, etc. The like button uses its own Graph Protocol API to do this, it essentially makes your page a facebook page and can be read as such. It's written like XML and defines things such as the thumbnail you want to show as your picture, the shortname of the site, etc. Go to developers.facebook.com to read all about the facebook API and app development and integrating into your webpage, etc.
you cand use this on github to share content on social media (includes facebook) and make your custom button!
You can use Facebook Like also. It performs the same as the Facebook share now appearing in your Facebook newsfeed with thumbnail, or
You can use some plugins like add this or you can use the following link:
<a name="fb_share" type="button" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

Categories