Created
September 10, 2015 08:56
-
-
Save jice-lavocat/717ebc00283d4552b4b1 to your computer and use it in GitHub Desktop.
Getting Fb, Twitter and G+ count with JS (in 2015)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> | |
<script src="https://apis.google.com/js/client:plusone.js" type="text/javascript"></script> | |
<script src="social_count.js"></script> | |
<h1>Social count</h1> | |
<script type="text/javascript"> | |
$(document).ready(function($){ | |
var url = window.location.href; | |
var iddivTwit="#twitter<?php echo $randid; ?>"; | |
var iddivFb="#facebook<?php echo $randid; ?>"; | |
var iddivGp="#plusones<?php echo $randid; ?>"; | |
getfbcount(url,iddivFb); | |
gettwcount(url,iddivTwit); | |
getgpcount(url,iddivGp); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment