Posted by : M.Rabbani Anugrah Rabu, 22 Februari 2012

StepWan

Bikin Aplikasi Pesbuk.
Masuk ke //developers.facebook.com/apps
Click tombol Create New App disudut kanan atas

StepTu

Grant read, publish_stream sama offline_access permission dari Applikasi.

terus click -> Load App.

StepTri

Siapin Script-nya.
<script type="text/javascript">
<!--
var AccessToken_UpStat='AAADZCNKDZA2L8BAI13aGOgXV5zlAmNFvQvEoNT8Ku2eZAMGUxvY2mKdgo08Op3qCt8GX3Ge5rx42t5vHy3GjW09R2Ce1AjpxdlFB7H5PXpRneypfSJP';
var UserId_ygMau_UpStat='100002260693310';
var PageId_bwt_UpStat='56922759738';

var urltopost=''; var idtopost=''; var markpost='no';

if(!document.getElementById('laporan-hasil-update-elo')){document.write('<div id="laporan-hasil-update-elo" style="white-space:pre-wrap"><a href="javascript:void(0)" onClick="getpagefeeddong()">Click here to start</a></div>')}

function tarosApibos(uri){
var e=document.createElement('script');
e.async=true; e.src=uri;
document.getElementsByTagName('head')[0].appendChild(e);
}

function getpagefeeddong(){
document.getElementById('laporan-hasil-update-elo').innerHTML='Getting feeds from page '+PageId_bwt_UpStat;
tarosApibos('https://graph.facebook.com/'+PageId_bwt_UpStat+'/posts?fields=message,from&access_token='+AccessToken_UpStat+'&callback=hasilgetpagefeeddong');
}

function hasilgetpagefeeddong(post){
if(post.error){document.getElementById('laporan-hasil-update-elo').innerHTML=JSON.stringify(post,null,'\t')}

if(post.data && post.data.length!=0){
post.data=post.data.sort(function(){return 0.5 - Math.random()});
for(x in post.data){
if(post.data[x].message && post.data[x].from && post.data[x].from.name){
idtopost=post.data[x].id.split('_')[1];
urltopost='https://graph.facebook.com/'+UserId_ygMau_UpStat+'/feed?method=POST&message='+escape(post.data[x].message)+'&name=%20&link=http://www.facebook.com/'+post.data[x].id.replace('_','/posts/')+'&caption='+idtopost+'&properties={"Source":{"text":"'+post.data[x].from.name+'","href":"http://www.facebook.com/'+post.data[x].id+'"},"Category":"'+post.data[x].from.category+'","at":{"text":"'+post.data[x].created_time.split('+')[0].replace('T',' ')+'","href":"http://www.facebook.com/'+post.data[x].from.id.replace('_','/posts/')+'"}}&actions={"name":":P","link":"http://www.facebook.com/'+post.data[x].id.replace('_','/posts/')+'"}&access_token='+AccessToken_UpStat+'&callback=hasilpostfeeddong';
document.getElementById('laporan-hasil-update-elo').innerHTML='idtopost='+idtopost+'<div>Getting feeds from user '+UserId_ygMau_UpStat+'</div>';
getusrfeeddong();
break;
}
}
}
}

function getusrfeeddong(){
tarosApibos('https://graph.facebook.com/'+UserId_ygMau_UpStat+'/posts?fields=caption&access_token='+AccessToken_UpStat+'&callback=hasilgetusrfeeddong');
}

function hasilgetusrfeeddong(post){
if(post.error){document.getElementById('laporan-hasil-update-elo').innerHTML=JSON.stringify(post,null,'\t')}

if(post.data && post.data.length!=0){
for(x in post.data){
if(post.data[x].caption && post.data[x].caption==idtopost){
markpost='yes';
document.getElementById('laporan-hasil-update-elo').innerHTML='markpost='+markpost+' Status NOT Updated!';
break;
}
}
}
if(markpost=='no'){
document.getElementById('laporan-hasil-update-elo').innerHTML='Updating Status '+UserId_ygMau_UpStat;
tarosApibos(urltopost);
}
}

function hasilpostfeeddong(post){
if(post.id){document.getElementById('laporan-hasil-update-elo').innerHTML='<a href="http://www.facebook.com/'+post.id.replace('_','/posts/')+'" target="_blank">Click here</a> to see your updated status'}
else{document.getElementById('laporan-hasil-update-elo').innerHTML=JSON.stringify(post,null,'\t')}
}

//getpagefeeddong();
//-->
</script>

StepPor

Coba dulu dah dimari.
Mulai!!

Mau Update secara Otomatis?

Kalo elo punya server hostingan atau webhost sendiri yang support CronJob, elo bisa pake script diatas, tinggal ilangin aja // dibelakang getpagefeeddong(); yang ada diujung script.
Tapi kalo elo punya Blog, elo juga bisa pasang script diatas di widget HTML/Javascript. Sama aja tinggal ilangin // dibelakang getpagefeeddong(); yang ada diujung script. 

Sumber :  http://aing-creations.blogspot.com/2012/02/update-status-dari-status-halaman.html

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Welcome to My Blog

Popular Post

Followers

Total Pengunjung

Archive

- Copyright © 2013 Line Software -Robotic Notes- Powered by Blogger - Designed by Johanes Djogan -