Statistics widget for blogger
Sunday, May 10, 2009
Leave a Comment
Statistics is a widget that shows the total no of posts and comments in your blog.The credits of this widget goes to Assess My Blog.This widget is featured here on the request of our reader Sherry.To show your blog statistics in your blog sidebar,copy the following code and paste it in your blog by Adding a new gadget -> HTML/JavaScript.
<script style="text/javascript">
function numberOfPosts(json) {
document.write('Total Posts: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
}
function numberOfComments(json) {
document.write('Total Comments: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
}
</script>
<ul><li><script src="http://yourblog.blogspot.com/feeds/posts/default?alt=json-in-script&callback=numberOfPosts"></script></li>
<li><script src="http://yourblog.blogspot.com/feeds/comments/default?alt=json-in-script&callback=numberOfComments"></script></li></ul>
<noscript><a href="http://assessmyblog.blogspot.com/" target="_blank">Widgets for Blogger</a> | <a href="http://www.radiusblogger.com" target="_blank">radiusblogger</a></noscript>
In the above code change yourblog with your blog name and Save the code and see the wiget working.
0 comments »
Leave your response!