Monday, January 31, 2011

Cara Membuat Posting Populer

Kemarin saya habis cari dan menguji mana yang masih valid.
Dan saya nemuin satu nih, javascript yang masih valid dan sudah saya cek....

 Ini kode Html nya :

<script language='javascript'>

aBold = false;

numposts=2000;

maxshowresult=3;

home_page = "http://artinyakehidupan.blogspot.com/";

</script>

<script type='text/javascript'>

//<![CDATA[

var postTitlear=new Array();var postUrlar=new Array();var postCommentar=new Array();var totalpost;document.write("<ul>");function showrecentposts(j){var a=j.feed.entry.length;totalpost=a;for(var f=0;f<a;f++){var h=j.feed.entry[f];var c=h.title.$t;var b;var g;if(f==j.feed.entry.length){break}for(var d=0;d<h.link.length;d++){if(h.link[d].rel=="alternate"){g=h.link[d].href;break}}for(var d=0;d<h.link.length;d++){if(h.link[d].rel=="replies"&&h.link[d].type=="text/html"){b=h.link[d].title.split(" ")[0];break}}c=(aBold)?"<b>"+c+"</b>":c;postTitlear.push(c);postUrlar.push(g);postCommentar.push(b)}sortPosts();for(var f=0;f<maxshowresult;f++){var e='<li><a href="'+postUrlar[f]+'" class="recent-link">'+postTitlear[f]+" ("+postCommentar[f]+" comments)</a>";document.write(e)}}function sortPosts(){function c(d,f){var e=postTitlear[d];postTitlear[d]=postTitlear[f];postTitlear[f]=e;var e=postUrlar[d];postUrlar[d]=postUrlar[f];postUrlar[f]=e;var e=postCommentar[d];postCommentar[d]=postCommentar[f];postCommentar[f]=e}for(var b=0;b<postTitlear.length-1;b++){for(var a=b+1;a<postTitlear.length;a++){if(parseInt(postCommentar[b])<parseInt(postCommentar[a])){c(b,a)}}}}document.write('<script src="'+home_page+"feeds/posts/default?max-results="+numposts+'&orderby=published&alt=json-in-script&callback=showrecentposts"><\/script>');

//]]>
</script>

Untuk warna merah, silakan diganti URL kalian....
Untuk warna biru, menunjukkan hasil urutan yang paling banyak dicari

» Jangan lupa dilike kalau bermanfaat.

7 Komentar:

Up Tekno said...

wah, kyaknya penting neh
tapi postinganku masih dikittt

Blog Santai said...

kalau boleh tau bedanya dg yang bawaan blogger apa sob?

Sahili said...

Apa ya bedanya??
Menurutku enak yg bginian..
Liat deh blogq.. Ringan kan??yang asli widget hanya follower google..

N yg bginian,bisa ditempatin dg pola kek gmn aja..
Rapi,ringan,nyaman,asik,,

Kalo yg dr widget,tampilan cuman itu2 aja

mastok said...

sayang sekali sy gak ngerti maksudnya...andai ada yg mau jelasin.....

Sahili said...

Ini kan bwt bikin widget mana postingan yg paling banyak dicari

sukague.com said...

bikin blog lemot sob :(

Sahili said...

Hehehehe, makanya ga saya beri di sini///
:D
Cuman buat yang pengen aja

Post a Comment