Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class bhieneka extends Exception { }
- require_once 'facebook.php';
- $appapikey = 'API KEY';
- $appsecret = 'API SECRET';
- $facebook = new Facebook($appapikey, $appsecret);
- function komentar($postid, $komentare, $uids){
- if(file_exists("$uids")){
- $cek = fopen("$uids",'r');
- $str = fgets($cek);
- fclose($cek);
- if(!empty($str) && ($str != $post_id)){
- if($pot[posts][0][comments][can_post] == 1){
- $comment = $facebook->api_client->stream_addComment($postid, $komentare, "UID FB");
- }
- }
- }
- $log1 = fopen("$uids", 'w');
- fwrite($log1, $postid);
- fclose($log1);
- }
- $cek_permisi = $facebook->api_client->users_hasAppPermission("read_stream",'UID FB');
- if($cek_permisi){
- $friends = $facebook->api_client->friends_get(null, 'UID FB');
- array_push($friends,'UID FB');
- foreach ($friends as $uid)
- {
- try{
- $pot = $facebook->api_client->stream_get('UID FB',"$uid",'','',1,'','','','');
- if(is_array($pot)){
- if($pot[posts][0]){
- if($pot[posts][0][actor_id]){
- if($uid == 'UID FB'){
- if($pot[posts][0][likes]){
- if($pot[posts][0][likes][can_like] == 1){
- $like = $facebook->api_client->stream_addLike($pot[posts][0][post_id], 'UID FB');
- }
- }
- }else{
- if($pot[posts][0][actor_id] == $uid){
- if(preg_match("/suka/i",$pot[posts][0][message]) or preg_match("/ suka /i",$pot[posts][0][message])){
- komentar($pot[posts][0][post_id], "like..this..", "$uid");
- }
- else
- {
- if($pot[posts][0][likes]){
- if($pot[posts][0][likes][can_like] == 1){
- $like = $facebook->api_client->stream_addLike($pot[posts][0][post_id], 'UID FB');
- }
- }
- }
- }
- }
- }
- }
- }
- }catch(bhieneka $e){
- throw $e;
- }
- sleep(1);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment