Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('Content-Type: text/html; charset=utf-8');
- $token = ['',
- '',
- '',
- ''];
- for($j =0;$j<count($token); $j++){
- $ids = json_decode(file_get_contents("https://graph.facebook.com/me/home?fields=id&limit=3&access_token=".$token[$j]));
- foreach($ids->data as $values){
- $id = $values->id;
- $file = fopen("noidung.txt", "r");
- $members = array("noi dung");
- $x= rand(0, count($members)-1);
- echo 'dang cmt cho bai viet ',$id,' noi dung ',$members[$x],PHP_EOL;
- if($id)
- {
- $post = [
- 'message' => $members[$x],
- 'access_token' => $token[$j],
- ];
- $url = 'https://graph.facebook.com/'.$id.'/comments';
- $ch = curl_init();
- curl_setopt_array($ch, array(
- CURLOPT_URL => $url,
- CURLOPT_POSTFIELDS => $post,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_SSL_VERIFYPEER => false,
- CURLOPT_VERBOSE => true
- ));
- $result = curl_exec($ch);
- file_get_contents("https://graph.facebook.com/".$id."/likes?method=post&access_token=".$token[$j]);
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement