I am trying to find a way to take the value of share social button see: http://www.1stwebdesigner.com/wordpress/wordpress-plugins-social-sharing/ Buttons are located on left side of the page.
Now I thought maybe using JavaScript on document ready to take the value of the specific span//div. however they are in a iframe and it seem to not work:
here is what I have so for:
<iframe id="something_iframe"
src="http://www.facebook.com/plugins/like.php?href=http://www.freelancer.com/projects/myskills.php&send=false&layout=button_count&width=100&show_faces=false&action=like&colorscheme=light"
scrolling="no" frameborder="0"
style="border:none; overflow:hidden; width:100px; height:21px;"
allowTransparency="true">
</iframe>
<div id="something">
</div>
<script>
var $j = jQuery.noConflict();
$j(document).ready(function() {
$j("#something").text($j(".pluginCountTextDisconnected").text());
});
</script>
I think however even if this JavaScript way would work its still messy and there probably a better way in PHP API or something.
This is simply not possible due to the same origin policy
because these spans are loaded inside a iFrame that has gets loaded from a different page than yours.
When the same origin policy is active you cannot manipulate the contents of the iFrame or access it. There may be some hacks around this, but I'd suggest you look at the API of twitter and Facebook as they are likely to expose the like/retweet count through the API.
This also has the benefit of not breaking whenever Twitter/Facebook changes something to their share buttons. These are not meant to be a public interface so they are free to change their code anytime.
Update: After looking a bit more at the Site markup it seems you can access the Google+ button as it is placed in the HTML of the side and not inside an iFrame, but Facebook and Twitter run their widget button inside an iFrame where you don't have access to.