https://github.com/sagautam5/social-share-count
Count social shares of a url
https://github.com/sagautam5/social-share-count
count share social
Last synced: 3 months ago
JSON representation
Count social shares of a url
- Host: GitHub
- URL: https://github.com/sagautam5/social-share-count
- Owner: sagautam5
- License: mit
- Created: 2020-09-16T16:10:38.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-21T09:06:22.000Z (almost 6 years ago)
- Last Synced: 2025-07-17T01:37:56.933Z (11 months ago)
- Topics: count, share, social
- Language: PHP
- Homepage:
- Size: 104 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Social Share Count
## This will help to count the social share count of a url
[](//packagist.org/packages/sagautam5/social-share-count)
[](//packagist.org/packages/sagautam5/social-share-count)
 [](https://github.com/sagautam5/social-share-count/stargazers) [](https://github.com/sagautam5/social-share-count/stargazers) [](https://github.com/sagautam5/social-share-count/stargazers) [](https://github.com/sagautam5/social-share-count/stargazers)
## Description
Social share count is the laravel package to determine number of times a url is shared on social media like facebook.
Social Share Count Requires
PHP >= 7.3.*
Laravel >= 7.0.*
## Support
- Facebook
- Pinterest
- Reddit
## Installation
```sh
composer require sagautam5/social-share-count
```
## Configuration
#### Facebook
At first, get App ID and App Secret by creating new app in https://developers.facebook.com.

Now, add those credentials in .env file.
```dotenv
FB_APP_ID='xxxxxxxxxxxxxxxx'
FB_APP_SECRET='XXXXXXXXXXXXXXXXXXXXXXXXXX'
```
Now, Clear the configuration cache.
```shell script
php artisan config:cache
```
#### Pinterest
Currently, you don't need any application id or secret to count pinterest shares. You can just call the function.
#### Reddit
Currently, you don't need any application id or secret to count reddit shares. You can just call the function.
## Basic Usage
After installation, you can use the share count feature like this:
```php
use Sagautam5\SocialShareCount\ShareCounter;
$url = 'https://www.example.com';
$facebookShares = ShareCounter::getFacebookShares($url);
echo $facebookShares;
$pinterestShares = ShareCounter::getPinterestShares($url);
echo $pinterestShares;
$redditShares = ShareCounter::getRedditShares($url);
echo $redditShares;
```
## 🤝 Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## 📄 License
The MIT License (MIT). Please see [License File](LICENSE) for more information.