This script will get number of shares of a post url from usual social networks and return the information as JSON.
- Facebook’s likes and shares
- LinkedIn’s shares
- Google plus’ shares
(You are free to put it anywhere you want if you know how to access it by url, of course.)
- Drop the file
getShares.phpin your wordpress main directory, next to wp-config.php file.
- Call the file by url, per example: http://yoursite.com/getShares.php
By default, the script return the last seven days posts, sorted by date of publication (by wordpress) and displayed in a table.
You can override this with parameters:
The script will return posts from the last day, sorted by shares count and in JSON format.
- Add a parameter to get result for only one specific url.
React to this article!
Did I miss something? I'd really liked to know your though about this.
If you like this article, please 📣 share-it!