xdimedrolx/shares

Social share counts

0.0.2 2015-09-21 09:23 UTC

This package is auto-updated.

Last update: 2024-10-23 08:10:43 UTC


README

A simple PHP library to fetch the count of social shares. Supported providers: vk.com, facebook.com, twitter.com, mail.ru, ok.ru

Requires

  • php: >=5.4
  • guzzlehttp/guzzle: ~5.2

Install

composer require xdimedrolx/shares

Usage

<?php

require_once 'vendor/autoload.php';

$shares = new \Shares\Shares(['defaults' => ['verify' => false]]);
$shares->addProvider(new \Shares\Providers\Vk());
$shares->addProvider(new \Shares\Providers\Facebook());
$shares->addProvider(new \Shares\Providers\Twitter());
$shares->addProvider(new \Shares\Providers\MailRu());
$shares->addProvider(new \Shares\Providers\Ok());
$results = $shares->getCounts('https://github.com');

print_r($results);