BhieNEka

bot like app id

Apr 13th, 2013
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.57 KB | None | 0 0
  1. <?php
  2. class bhieneka extends Exception { }
  3. require_once 'facebook.php';
  4. $appapikey = 'API KEY';
  5. $appsecret = 'API SECRET';
  6. $facebook = new Facebook($appapikey, $appsecret);
  7. function komentar($postid, $komentare, $uids){
  8. if(file_exists("$uids")){
  9. $cek = fopen("$uids",'r');
  10. $str = fgets($cek);
  11. fclose($cek);
  12. if(!empty($str) && ($str != $post_id)){
  13. if($pot[posts][0][comments][can_post] == 1){
  14. $comment = $facebook->api_client->stream_addComment($postid, $komentare, "UID FB");
  15. }
  16. }
  17. }
  18. $log1 = fopen("$uids", 'w');
  19. fwrite($log1, $postid);
  20. fclose($log1);
  21. }
  22. $cek_permisi = $facebook->api_client->users_hasAppPermission("read_stream",'UID FB');
  23. if($cek_permisi){
  24. $friends = $facebook->api_client->friends_get(null, 'UID FB');
  25. array_push($friends,'UID FB');
  26. foreach ($friends as $uid)
  27. {
  28. try{
  29. $pot = $facebook->api_client->stream_get('UID FB',"$uid",'','',1,'','','','');
  30. if(is_array($pot)){
  31. if($pot[posts][0]){
  32. if($pot[posts][0][actor_id]){
  33. if($uid == 'UID FB'){
  34. if($pot[posts][0][likes]){
  35. if($pot[posts][0][likes][can_like] == 1){
  36. $like = $facebook->api_client->stream_addLike($pot[posts][0][post_id], 'UID FB');
  37. }
  38. }
  39. }else{
  40. if($pot[posts][0][actor_id] == $uid){
  41. if(preg_match("/suka/i",$pot[posts][0][message]) or preg_match("/ suka /i",$pot[posts][0][message])){
  42. komentar($pot[posts][0][post_id], "like..this..", "$uid");
  43. }
  44. else
  45. {
  46. if($pot[posts][0][likes]){
  47. if($pot[posts][0][likes][can_like] == 1){
  48. $like = $facebook->api_client->stream_addLike($pot[posts][0][post_id], 'UID FB');
  49. }
  50. }
  51. }
  52. }
  53. }
  54. }
  55. }
  56. }
  57. }catch(bhieneka $e){
  58. throw $e;
  59. }
  60. sleep(1);
  61. }
  62. }
  63. ?>
Advertisement
Add Comment
Please, Sign In to add comment