jQuery Plugin To Get Likes, Comments and Tweets From An URL - Social Stats
File Size: | 3.52 KB |
---|---|
Views Total: | 3515 |
Last Update: | |
Publish Date: | |
Official Website: | Go to website |
License: | MIT |
Social stats is a tiny social media plugin used to get Facebook likes, comments and Twitter tweets from a given URL and display them as plain text on your web page.
How to use it:
1. Include reference to jQuery library and jQuery social stats plugin at the bottom of the web page.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script src="jquery.socialstats.js"></script>
2. Create an Html elements where you want to display the social stats. Use data-*
attribute to specify which type of social stats you want to display.
<span class="socialstats" data-network="twitter" data-url="https://www.jqueryscript.net"></span> <span class="socialstats" data-network="facebook" data-action="likes" data-url="https://www.jqueryscript.net"></span> <span class="socialstats" data-network="facebook" data-action="comments" data-url="https://www.jqueryscript.net"></span>
3. Call the plugin on the Html elements with class of 'socialstats'.
<script> jQuery(document).ready(function($){ $(".socialstats").socialstats(); }); </script>
This awesome jQuery plugin is developed by hyperbolicbr. For more Advanced Usages, please check the demo page or visit the official website.