Main menu
WalkswithMeSocial NetworkingTwitter FaceBook Gplus Pinterest Followers Using PHP

Twitter FaceBook Gplus Pinterest Followers Using PHP

Twitter FaceBook Gplus Pinterest followers count using PHP , In many cases we need such a solution using Oauth or CURL method. Here I will explain how we can get most used social media accounts followers count using basic PHP script.

First we can discuss about  Twitter followers Count

We know that twitter API version 1.0 is no more available now API 1.1 is used so , we have to use the Oauth method. First you have to create Twitter APP and get the API key and secret key, Just follow my Post to twitter using PHP Oauth article. also download the library files from the post, After getting the keys try the following codes.

require_once 'twitteroauth.php';
define("CONSUMER_KEY", "****consumer key*******");
define("CONSUMER_SECRET", "*******Consumer secret********");
define("OAUTH_TOKEN", "**********Oauth token*******");
define("OAUTH_SECRET", "*****Oauth Secret********");
$username = 'Walkswithmenet'; //Your twitter screen name or page name
$followers = $connection->get(''.$username);
echo ($followers->followers_count);
  Pinterest Followers Count

For reading your Pinterest account followers count simply use the following scripts.

$metas = get_meta_tags(' PINTREST ACCOUNT NAME/');
social media followers count

social media followers count

  FaceBook Followers Count

Just parse the return data from Facebook, its a JSON array

$FBFollow = file_get_contents('');
$data = json_decode($FBFollow);
echo $data[0]->fan_count;
  Google Plus Followers Count

For reading your gplus account followers you have to create an APP with Google then you will get an access token, then simply apply with your page ID and access token to get the followers. Create a Google APP with Google console

// get api
$google_api_key = 'YOUR_API';
$page_id = 'YOUR_PAGE_ID';
$data = @file_get_contents("$page_id?key=$google_api_key");
$data = json_decode($data, true);
echo $data['plusOneCount'];

Hope this article will help you to get common social media followers count using PHP. including the Facebook Twitter Pinterest and Gplus accounts

One thought on “Twitter FaceBook Gplus Pinterest Followers Using PHP

Leave a Reply

Your email address will not be published. Required fields are marked *