handelsgids/sharedcount

此包已被弃用,不再维护。没有推荐替代包。

Sharedcount.com API 的 PHP 封装器。

v1.1.2 2021-09-01 11:46 UTC

This package is auto-updated.

Last update: 2022-01-18 15:52:45 UTC


README

简介

Sharedcount.com API 的 PHP 封装器。

安装

composer require handelsgids/sharedcount

示例

<?php

require 'vendor/autoload.php';

use Handelsgids\Sharedcount\Sharedcount;

$sharedcount = new Sharedcount('yourapikeygoeshere');
$facebookShares = $sharedcount
    ->getByUrl('https://www.handelsgids.be')
    ->getFacebook()
    ->getShareCount()
;

上面的示例将输出

5008

配置

确保定义您是否有免费或付费订阅。

默认为免费。使用以下行设置付费订阅。

$sharedcount = new Sharedcount('yourapikeygoeshere', Sharedcount::SUBSCRIPTION_PAYING);

运行测试

在 phpunit.xml 中设置您的 Sharedcount API 密钥,然后运行 composer test

许可

Handelsgids Sharedcount PHP Wrapper 是开源软件,受 MIT 许可证许可。