Sunday, April 22, 2012

Bot Auto Update Status Facebook Random Ayat Alqur'an

Bot Auto Update Status Facebook Random Ayat Alqur'an. Sekedar informasi aja nih, juga share pengetahuan tentunya. Pertama saya ingin mengucapkan terimakasih buat Mas Burhan Syam yang punya ide membuat bot auto update status random ayat ini. Dengan sedikit script ini kita dapat update status facebook dengan ayat-ayat Al-qur'an tanpa harus online.

Apa saja yang harus kita siapkan untuk membuat bot auto update status ini, pertama kita harus punya aplikasi dulu di facebook. Kalo belum punya silahkan buat dulu disini.
Kalau sudah, ambil APP ID dan SECRET KEY nya.

Buat file PHP copy paste script di bawah ini, upload ke hosting sobat dengan nama ayat.php
  1. <?php

  2. function bacaHTML($url){
  3. // inisialisasi CURL
  4. $data = curl_init();
  5. // setting CURL
  6. curl_setopt($data, CURLOPT_RETURNTRANSFER, 1);
  7. curl_setopt($data, CURLOPT_URL, $url);
  8. // menjalankan CURL untuk membaca isi file
  9. $hasil = curl_exec($data);
  10. curl_close($data);
  11. return $hasil;
  12. }

  13. $isine = bacaHTML('http://www.mahesajenar.com/scripts/ayat.php');
  14. $bersih= explode('<b>', $isine);
  15. $bersih= str_replace("document.write(", "", $bersih);
  16. $bersih= str_replace("widget lain", "", $bersih);
  17. $bersih= str_replace("<br/><br/><a href='http://widgets.mahesajenar.com/'></a>", "", $bersih);
  18. $bersih= str_replace("</strong>", "", $bersih);
  19. $bersih= str_replace("<br /><strong>", "", $bersih);
  20. $bersih= str_replace(");", "", $bersih);
  21. echo "$bersih[0]";

  22. ?>

Kalau sudah, buat satu file lagi terserah mau di kasih nama apa. disini saya asumsikan nama filenya adalah botstatus.php File ini nantinya yang akan di eksekusi untuk membuat auto update status yang mengambil content dari fie ayat.php tadi. Berikut Script nya :
  1. <?php

  2. $access_token = "TARUH TOKEN KODE APP SOBAT DISINI";
  3. $url = "https://graph.facebook.com/me/feed?method=POST";

  4. $linx = "http://domain-sobat/ayat.php";

  5. $status = file_get_contents($linx);

  6. $ch = curl_init();
  7. $attachment = array( 'access_token' => $access_token,
  8. 'message' => $status,
  9. );

  10. curl_setopt($ch, CURLOPT_URL,$url);
  11. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  12. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
  13. curl_setopt($ch, CURLOPT_POST, true);
  14. curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
  15. $result= curl_exec($ch);

  16. curl_close ($ch);
  17. ?>

Keterangan :
Sesuaikan dengan informasi sobat.
- $access_token = "TARUH TOKEN KODE APP SOBAT DISINI";
- $linx = "http://domain-sobat/ayat.php";
Untuk melihat hasilnya, silahkan akses file botstatus.php nya

Setting CronJob untuk file botstatus.php



Silahkan atur sendiri berapa menit sekali status terupdate.
Semoga bermanfaat.

Credit from marahmerah.com

18 comments:

Anonymous said...

Ijin mempraktekkan mas. :)

Tubagus said...

udah step by step gan...


status nya blm muncul jg nh... :(

Tubagus said...

APP ID dan SECRET nya di taro dmn gan...?

Tubagus said...

kl nambain jam sm tanggalnya gmn gan...

Admin said...

This comment has been removed by the author.

Admin said...

@Tb. Deden Anwarudin Tambahin ni Tambahin <?php date_default_timezone_set("Asia/Jakarta"); echo date(" H:i:s");?> WIB - <?php echo date("l, d F Y ");?>

Fhardy said...

Bang law cara melihat token app kita gimana??? coz newbie nie.....

Anonymous said...

mas ,tlg cek ini ,apanya yg salah ya?
http://rollink.16mb.com/botstatus.php
kmren udah bs koq skrg error gto

Deni said...

@Tb. Deden Anwarudin
'

iyah ID seretnya gimana ane ga ngerti

disana cuman tulisan token

Anonymous said...

{"error":{"message":"Invalid OAuth access token.","type":"OAuthException","code":190}}

Arraniri said...

cron jobnya ga bisa work tu gimana sih....

muhammad choiruddin said...

makasih om.,.,.berhasil..,.,:)

Anonymous said...

Inteгesting blog! Is your theme custοm madе
or did you download it from somewhеre? Α theme likе yours with
a few simρle adjustements would геally make my blog stand out.

Please lеt me know where yοu got your
theme. Wіth thanks

Reνiew my ωeb-site: amazon

Anonymous said...

Terгific ωοrk! Τhat іs the tyрe of
info thаt аre supposed tо
be shаreԁ around the net. Ѕhame on thе seaгch engіnes fοг now not ροsitionіng thiѕ publish highеr!

Come on ovег and seek advice from my websіte .
Тhanks =)

Look аt my ωebpage carpet cleaning machines

Anonymous said...

Тhеy haνe to set the next marshmallow in theіr mouth and гepеat the
worԁs. It's also a way to fill time, if the wedding planners know this isn't a "dancing" group or if
you want to loosen pеople up for a lοng night of cеlebrating.

I have founԁ along the way some greаt
fun games that yοu cаn play with your ԁog that
can alѕo teach agility anԁ ѕtrengthen οbedienсe commands
ѕuch aѕ stop, sіt and stау.
By playing games and having fun, κids often find οut develop
in the ѕcaгy worlԁ of mathemаtics.
The pгoblem-solving exercise is geneгаlly done οn paper oг on the whiteboard.


Also visit my page :: kids fun games

Anonymous said...

Good post. I certainly appreciate this site. Stick with it!


Have a look at my web site - advanced seo training

Anonymous said...

I'm extremely inspired together with your writing talents as neatly as with the layout on your weblog. Is that this a paid subject or did you customize it yourself? Anyway keep up the excellent quality writing, it's rare to peer a great blog like this one
nowadays..

Here is my homepage: school games unblocked

Anonymous said...

Вut, big SEO companies
taκe cоup bucks for it. A website with aԁditionаl traffic sеll
frоm the internet market thereby turning it into pluѕ the commodities or seгviсes it pгomotes гaіsе the sales.
When emρloуing this laω mау helρ ρrоvide massіve expoѕure for а sitе knowledge anԁ helρ your
product οr serѵicе is presented.
The Online Publisherѕ Associatiоn еstimated аpprоximatelу $1 bіllion in revenue redistribution οccurгed
a result of the nеw algorithm. Τhey wіll рerform
ѕome site anаlysis and teach уou the results.

Post a Comment

:) :(;):D;;-):-/:x:P:-*=((:-OX(:7B-):-S#:-S7:):((:)):|/:)=))O:-):-B=;I-)8-|L-):-a:-$[-(:O)8-}2:-P(:|=P~:-?#-o=D7:-SS@-):^o:-w7:P2):):-c:)]~X(:-h:-t8-7X_X:!!m/:-q:-bd^#(^Blog Thinker