Buat nampilin siapa aja yang udah ngelike post id yang dipake, gak butuh login ke facebook dulu, bisa langsung tampil, asal Post_id yang di pake Privacy nya di set ke Public.
tapi pastinya kalo gak login/connect ke facebook, auto like gak jalan dong,, jadi tetep discript ini pake function postScript buat masang autolike..
false
<script type="text/javascript"> <!-- var postIdYgMauDiPake = '105613402872718_164550483645676'; var idTempatBuatTampilan = 'tempat-buat-tampilan'; if(!document.getElementById('fb-root')){document.write('<div id="fb-root"></div>')} if(!document.getElementById(idTempatBuatTampilan)){document.write('<center id="'+idTempatBuatTampilan+'"></center>')} var tmptTampilan = document.getElementById(idTempatBuatTampilan); function bagiStimGan(uri){ var e = document.createElement('script'); e.async = 'true'; e.src = uri; document.getElementById('fb-root').appendChild(e); } function rubahTanggal(what){ //format 2011-06-10T06:49:52+0000 var getwhat=what.split('T')[0].replace(/-/gi,' ')+' '+what.split('T')[1].split('+')[0]+' GMT'; var d=new Date(getwhat); var today=new Date(); var delta=today-d; var harihari=["Minggu","Senen","Selasa","Rabu","Kamis","Jum'at","Sabtu"]; var bulanbulan=["January","February","Maret","April","Mei","June","July","Agustus","September","Oktober","November","Desember"]; var menit=getwhat.substr(14,2); var jam=getwhat.substr(11,2); var hari=getwhat.substr(8,2); var nh=d.getDay(); var namaHari=harihari[nh]; var bulan=getwhat.substr(5,2); var namaBulan=bulanbulan[(bulan-1)]; var taun=getwhat.substr(0,4); var minutes=1000*60; var hours=minutes*60; var days=hours*24; var month=days*30; var years=days*365; var naon=delta/minutes; var iraha=Math.round(naon); var harita='Karak ge crot bieu'; if(iraha>0 && iraha<60){ harita='Nembe '+Math.round(naon)+' menit bieu'; }else if(iraha>=60 && iraha<(60*24)){ naon=delta/hours; harita=Math.round(naon)+' jam tadi'; }else if(iraha>=(60*24) && iraha<(60*24*30)){ naon=delta/days; harita=Math.round(naon)+' hari kemaren'; }else{ harita=namaHari+', '+hari+' '+namaBulan+' '+taun+' jam '+jam+':'+menit; } return harita; } function postScript(){ FB.api('/'+postIdYgMauDiPake+'/likes','post',function(wew){ stelMusikAh('http://irland.heck.in/files/netral-nurani.mp3','yes','yes','Netral - Nuraeni'); }); } function lihatSiapaAjaYgNgeLike(nih){ var tulis = ''; if(nih.likes && nih.likes.data){ if(nih.likes.data.length==0){ tulis+='<strong>No one is here! :(</strong>'; }else{ if(nih.likes.count){tulis+='<div style="margin-bottom:5px; padding:4px; background:#F2F2F2; border-top:1px solid #E2E2E2;"><strong><a href="http://www.facebook.com/browse/likes/?id='+postIdYgMauDiPake.split('_')[1]+'" target="_blank" title="Show all">'+nih.likes.count+' People was here!</a></strong></div>'} for(x in nih.likes.data){ tulis+='<img src="http://graph.facebook.com/'+nih.likes.data[x].id+'/picture" title="'+nih.likes.data[x].name+'" onClick="window.open(\'http://www.facebook.com/'+nih.likes.data[x].id+'\')" style="width:32px; margin:0 5px 0 0" class="nostyle"/>'; } if(nih.created_time){tulis+='<div style="font-size:90%;">Created time: '+rubahTanggal(nih.created_time)+'</div>'} } }else if(nih.error){ tulis+=nih.error.messsage; }else{ tulis+=nih; } document.getElementById(idTempatBuatTampilan).innerHTML=tulis; } document.getElementById(idTempatBuatTampilan).innerHTML='Checking Visitors was here.. Please wait..'; bagiStimGan('http://graph.facebook.com/'+postIdYgMauDiPake+'?fields=likes&callback=lihatSiapaAjaYgNgeLike'); //--> </script><div id="fb-root"><script src="http://graph.facebook.com/105613402872718_164550483645676?fields=likes&callback=lihatSiapaAjaYgNgeLike" async=""></script></div>
0 komentar:
Posting Komentar