Posted in PHP Tutorial

Creating a social share Counter in PHP

Creating a social share Counter in PHP Posted on February 18, 2015Leave a comment

Deepanker Verma is the CEO of Techlomedia and a full time blogger. On this blog, he shares web design resources, SEO tips blog monetization tips.

social share counter
Best WordPress Hosting

Few days back, I was working on PHP script to count the number of times a URL was shared on different social network. So, I thought to share it with you all. In this script, you only need to enter the URL and it will show you the share count in Twitter, Facebook, Linkedin, Google+, Stumbleupon, Pinterest, deliciousĀ and buffer. Of course you can add more if you want.

But I tried basically only for these social websites. Approach was pretty simple. All websites offers their APIs to count these things. I only used those things.social share counter

Demo

Advertisement

If you have ever worked with APIs, you can easily understand how the things are working. For example, I created this function for Twitter.

The above function will return the count of tweets a URL got on Twitter.

A similar kind of code for linkedin

The above function will fetch the LinkedIn share cont.

This function is for counting Facebook share.

You can download the full working code here

Download

Please share this tutorial with your friends and help us.

advertisement

Deepanker Verma is the CEO of Techlomedia and a full time blogger. On this blog, he shares web design resources, SEO tips blog monetization tips.

Leave a Reply

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

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Receive fresh web design resources and SEO tips in your email by our weekly newsletter

You have Successfully Subscribed!