Skip to main content

Facebook Fan page Count in Simple Text HTML

Step 1 – Get API Key, Application Secret & Page ID

These are the three mandatory information you’ll need to get things started.

API Key and Application Secret

  1. Sign in to your Facebook and click on Developer‘s link on the site bar. (If you don’t have a Developer’s account, you will have to sign up for one first)

    facebook developer link How to Display Facebook Fan Count in Text

  2. Click "Set Up New Application". Enter any application name, agree to the Facebook terms and click "Create Application". Note: We are not going to create a real application, but we’ll need to go through these processes to get a API Key and Application Secret.
    create application How to Display Facebook Fan Count in Text
  3. On the next page, you should be able to see your personal API Key and Application Secret. Copy it down somewhere or leave the browser window open.
    api key How to Display Facebook Fan Count in Text

Page ID

Page ID is the ID of your Facebook Fan Page. If you don’t have a Facebook Fan page, you’ll have to first create one. To get the ID of your Fan page, click edit page, and look for your ID (numbers) at the end of the URL – http://www.facebook.com/pages/edit/?id=XXXXXXXXX

Step 2 – Get Facebook.php

You’ll also need the Facebook API PHP SDK file called Facebook.php. Download it, and place it in the root of your folder. Learn more about Facebook PHP SDK.

php sdk How to Display Facebook Fan Count in Text

Step 3 – Display Fancount

To show off your fancount, place the following code in your php file,



<?php

require_once('facebook.php');

$facebook = new Facebook(array(

'appId' => 'app_id',

'secret' => 'secret_key',

'cookie' => true,

));

$result = $facebook->api(array(

'method' => 'fql.query',

'query' => 'select fan_count from page where page_id = page_id;'

));

$fb_fans = $result[0]['fan_count'];

?>


Link to get codes


And then you will want to edit the codes to change the following:

Line 4 – Replace app_id with your Facebook Application ID.

Line 5 – Replace secret_key with Secret.

Line 10 – Replace the last page_id with your Facebook Fanpage ID.


<?php echo $fb_fans; ?>


Please refer to Step 1 on how to get app_id, secret_key and page_id.

To display the fancount, insert this following code anywhere in the page:

********************************************

Source : http://www.hongkiat.com/blog/how-to-display-facebook-fan-count-in-text/

********************************************

Comments

Popular posts from this blog

ජාතික ගීය හෝ ජාතික ධජය, අන්තවාදය පෙන්වන ආභරණයන් නොවේ..

ජාතික ගීය හෝ ජාතික ධජය, ජාතික ධජයේ වර්ණයන් යනු තොපේ ජාතිය හෝ ධර්මය පෙන්වන ආභරණයන් නොවේ.. එය ජාත්‍යාලය, දේශාභිමානය‍‍‍ හා දේශයේ පෞඪත්වය පෙන්වන ජාතියේ අනන්‍යතාව යයි.  ජාතිය යනු ශ්‍රී ලාංකික ජාතියයි.  ලංකාවේ සම"හරක්" වැනි පටු අරමුණු සහිත වූවන් ඉන්දියාව වැනි රටක රජවී සිටියානම් ඔවුන්ගේ ජාතික ගීය භාශා 1000 කින් පමණ remix වන්නට ඉඩ තිබුණි.  සරල උදාහරණයක් - ඉන්දියාව හා දකුණු අප්‍රිකාව අතර 20-20 ලෝක කුසලානයේ තරගයෙන් පසුව, ඉන්දීය ජාතික කොඩියේ වර්ණයන් ගෙන් යුතුවූ සමරු ලෙහෙන්සුවක් මා දෝනී වෙත ලබාදී ඔහුගෙන් සමරු සටහනක් ඉල්ලූ අවස්තාවේ ඔහු ඔහුගේ කැප් එක මට ලබාදී පැවසුවේ. කෙදිනකවත් ඉන්දියානුවෙකු තම ජාතික කොඩියට හෝ තම රටට අගෞරව නොකරන බවයි.  (මට දෝනී පේන්න බැරි චරිතයකි)  ඔවුන් තුළ ඇති දේශාභිමානය‍‍‍..... ඔවුන්ගේ ජාතික අනන්‍යතාවය මතු පරපුර වෙනුවෙන් ඉතිරිකොට ඇත.

Blogged: බයියන් - ටොයියන් - කබ්බන් හා රූකඩ අතර සිරවුන තරුණ චන්ද

එවකට නිදහස් පක්ෂය ලෙස පිරිසක් හිටපු ජනපති දිනවීමට දිවිහිමියෙන් කටයුතු කලේය. නමුත් අවසානයේ ඔහුට පරාජය වීමට සිදුවිය. නිදහස් පක්ෂයේම වුවත් එහි විරුද්ධ පක්ෂ හා කඳුවුරු බැඳි එවකට සෞඛ්‍ය ඇමතිවරයා ජනපති විය. පරාජිත පාක්ෂිකයන් හා ජයග්‍රාහී පාක්ෂිකයන් කාකොටා ගැනීම ආරම්භ කලේය. පරාජිත පාක්ෂිකයන් තම පරාජිත හැඟීම පිට කලේ, ‍ජාතිවාදය, යුද මානසිකත්වය, හා පුද්ගල චරිත පදනම් කරගනිමිනි. ඒ ඔවුන් එම තත්වයට පත්කල ජනතාවගේ නි‍යෝජිතයන් කියාගන්නා පිරිසක් හේතුවෙනි. ජයග්‍රාහී පාක්ෂිකයන්, සතුට භුක්තිවිඳීම ආරම්භ කලේ ජයග්‍රහණය සැමරීම පසෙකලා පරාජිතයන්ගේ හැඟීම් වලට පහර දෙමිනි. එයද මහජන නියෝජිතයන් යැයි කියාගන්නා පිරිසකගේ අවශ්‍යතා පිරිමැසීමක් විනා අන් කිසිවක් නොවේ. පරාජිතයන්, නැවත නැගී සිටීමට සියලු උත්සාහයන් දැරීම ‍ස්වාභාවිකය. ඒ අනුව නිදහස් පක්ෂය කටයුතු කරනවාද යන්න සැක උපදවයි. ඔවුන් එය පසෙකලා ජයග්‍රාහී පක්ෂයේ ඕනෑ එපාකම් ඉටුකිරීමට සෘජුව හා වක්‍රව වපසරිය සකසමින් සිටී. නැවත බලය තහවුරු කරගැනීමට ඇතැම් බලවේග පෙළගැසෙද්දී හිටපු ජනපතිවරයා තම ලේ දහඩිය වැයකල ප්‍රධාන පක්ෂය ඊට සහභාගීවීම ප්‍රසිද්ධියේ ප්‍රතික්ෂේප කලේය. එසේ...

Why some Tweets Cannot RT via Web Base twitter...?

You may have experienced this error messege when trying retweet someones tweet via Twitter web base. "Your account may not be allowed to perform this action. Please refresh the page and try again." It shows asks that you to refresh and Re try. But the result will be same as earlier and the shortest option is to ignore what you trying. Reason : You get this error when you try to RT a long Tweet which included at least 130+ characters. As soon you click RT button it Auto adding the tweet owners Twitter Handle and "RT :" front of the related tweet. if the tweet doesn't meet required character space to fill it shows errors. As you know a single twit can contain only 140 characters Maximum. If you really need to use the statement Copy it, Remove unnecessary part and add the Owners Handle Manually and Tweet. Some 3rd Part Twitter Clients have editing option available to when you trying to RT a tweet and it will show how many characters exceeded.