Git Product home page Git Product logo

php-social-counter's Introduction

PHP Social Counter Plugin

Grabs the latest counts of your fans/followers etc.

You can define what social networking sites you want to the plugin to display the information for. You can add any user ID or website URL to the plugin so that you can retrieve the counts for a different site than the one you have the plugin installed on.

Demo

How To Use ?

Require Plugin File

--

composer require tatwerat/social-counter
// use composer
use tatwerat\SocialCounter\SocialCounter;
// require plugin
require "./SocialCounter.php";
$SocialCounter = new SocialCounter([
    'facebook_id' => '{user_id}',
    'twitter_id' => '{user_id}',
    'youtube_id' => '{user_name or channel id}',
    'dribbble_id' => '{user_id}',
    'github_id' => '{user_id}',
    'soundcloud_id' => '{user_id}',
    'behance_id' => '{user_id}',
    'instagram_id' => '{user_id}',
    'google_api_key' => 'xxxxxxxx',
    'dribbble_access_token' => 'xxxxxxxxxxxxxx',
    'soundcloud_api_key' => 'xxxxxxxxxxxxxx',
    'behance_api_key' => 'xxxxxxxxxxxxxx',
    'pinterest_id' => '{user_name}',
]);
 
$SocialCounter->cache = true; // Cache Social Counts ( improvement the loading of your server )

If you want to return all social count you can use this code

$counts_data = $SocialCounter->print_data();
echo $counts_data['facebook'];
echo $counts_data['twitter'];
echo $counts_data['instagram'];
echo $counts_data['youtube'];
echo $counts_data['dribbble'];
echo $counts_data['behance'];
echo $counts_data['soundcloud'];
echo $counts_data['github'];
echo $counts_data['pinterest'];

If you want to call function one by one use this code

echo $SocialCounter->facebook_count();
echo $SocialCounter->twitter_count();
echo $SocialCounter->youtube_count(); // parameter ($type = 'channel' or 'user') : default value='channel'
echo $SocialCounter->dribbble_count();
echo $SocialCounter->github_count();
echo $SocialCounter->soundcloud_count();
echo $SocialCounter->behance_count();
echo $SocialCounter->instagram_count();
echo $SocialCounter->pinterest_count();

List Of Social Networks

  • Display Facebook Fans Count
  • Display Twitter Follower Count
  • Display Instagram Follower Count
  • Display YouTube Subscribers Count
  • Display GitHub Follower Count
  • Display SoundCloud Follower Count
  • Display Behance Follower Count
  • Display Dribbble Follower Count
  • Display Pinterest Follower Count

php-social-counter's People

Contributors

abdo-host avatar openhaus avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.