recent post list blogger
recent post list blogger
by asfar mohamed
HTML
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
function numberOfPosts(json) {
var cntpst = json.feed.openSearch$totalResults.$t;
var cmntcnt = json.feed.openSearch$totalResults.$t;
document.write(cntpst);
document.write("<br/>");
document.write('<div class="skillbar clearfix " data-percent="26%"> <div class="skillbar-title" style="background: #88cd2a;"><span>HTML5</span></div> <div class="skillbar-bar" style="background: #88cd2a;"></div> <div class="skill-bar-percent">'+cntpst+'%</div> </div>');
document.write("<br/>");
var number1 = cntpst;
var number2 = cmntcnt;
document.write(Math.floor((number1 / number2) * 100));
}
</script>
<br />
<ul>
<li><script src="http://inlikethisday.blogspot.com/feeds/posts/default?alt=json-in-script&callback=numberOfPosts"></script></li>
<li><script src="http://3rbaway.blogspot.com/feeds/comments/default?alt=json-in-script&callback=numberOfComments"></script></li>
CSS
@import url(http://fonts.googleapis.com/css?family=Open+Sans);
.skillbar {
font-family: 'Open Sans', 'sans-serif';
position:relative;
display:block;
margin-bottom:15px;
width:100%;
background:#eee;
height:35px;
border-radius:3px;
-moz-border-radius:3px;
-webkit-border-radius:3px;
-webkit-transition:0.4s linear;
-moz-transition:0.4s linear;
-ms-transition:0.4s linear;
-o-transition:0.4s linear;
transition:0.4s linear;
-webkit-transition-property:width, background-color;
-moz-transition-property:width, background-color;
-ms-transition-property:width, background-color;
-o-transition-property:width, background-color;
transition-property:width, background-color;
}
.skillbar-title {
position:absolute;
top:0;
left:0;
font-weight:bold;
font-size:13px;
color:#fff;
background:#6adcfa;
-webkit-border-top-left-radius:3px;
-webkit-border-bottom-left-radius:4px;
-moz-border-radius-topleft:3px;
-moz-border-radius-bottomleft:3px;
border-top-left-radius:3px;
border-bottom-left-radius:3px;
}
.skillbar-title span {
display:block;
background:rgba(0, 0, 0, 0.1);
padding:0 20px;
height:35px;
line-height:35px;
-webkit-border-top-left-radius:3px;
-webkit-border-bottom-left-radius:3px;
-moz-border-radius-topleft:3px;
-moz-border-radius-bottomleft:3px;
border-top-left-radius:3px;
border-bottom-left-radius:3px;
}
.skillbar-bar {
height:35px;
width:0px;
background:#6adcfa;
border-radius:3px;
-moz-border-radius:3px;
-webkit-border-radius:3px;
}
.skill-bar-percent {
position:absolute;
right:10px;
top:0;
font-size:11px;
height:35px;
line-height:35px;
color:#444;
color:rgba(0, 0, 0, 0.4);
}
JavaScript
jQuery('.skillbar').each(function(){
jQuery(this).find('.skillbar-bar').animate({
width:jQuery(this).attr('data-percent')
},2000);
});