Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = "localhost";
- $dbname = "penggoda_a";
- $dbpass = "erin";
- $username = "penggoda_a";
- $token = $_POST["token"];
- if($token != null)
- {
- //check token invalid
- $ch = curl_init("https://graph.facebook.com/me?access_token=".$token);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $sintoken = curl_exec($ch);
- curl_close($ch);
- $intoken = strripos($sintoken, "OAuthException");
- if($intoken === false)
- {
- //dapat data
- $ch2 = curl_init("https://graph.facebook.com/me?access_token=".$token);
- curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
- $dpt = curl_exec($ch2);
- curl_close($ch2);
- $id = json_decode($dpt);
- $a = "a";
- $ids = $id->id.$a;
- //data status id
- $ch3 = curl_init("https://graph.facebook.com/me/feed?fields=id,message&access_token=".$token);
- curl_setopt($ch3, CURLOPT_RETURNTRANSFER, true);
- $staid = curl_exec($ch3);
- curl_close($ch3);
- $taz = json_decode($staid)->data;
- foreach($taz as $tetek)
- {
- echo '<body style="background-color:black; width:100%;">
- <center>
- <div style="border:3px grey outset; background-color:grey; width:60%;">
- <form action="" method="post">
- <font color="red">STATUS:</font><font color="white">'.$tetek->message.'</font>
- <input type="hidden" name="token" value="'.$token.'">
- <font color="white" style="float:left;">statusid:</font><input name="statusid" value="'.$tetek->id.'" style="float:left;">
- <input type="submit" style="float:right; border:3px red outset; color:white; background-color:red;" value="Autolike">
- </form><br /></div><br />';
- }
- //mysql connect
- $konet = mysqli_connect($host, $username, $dbpass, $dbname);
- if(!$konet)
- {
- die("cannot conect");
- }
- $qui = "CREATE TABLE otolike(idfb CHAR(255), token CHAR(255))";
- mysqli_query($konet, $qui);
- $taz = mysqli_query($konet, "SELECT * FROM otolike");
- while($tob = mysqli_fetch_array($taz))
- {
- $tes.=$tob["idfb"];
- }
- //cek token ada atw x
- $cek = strripos($tes, $ids);
- if($cek === false)
- {
- mysqli_query($konet, "INSERT INTO otolike(idfb, token) VALUES ('".$ids."', '".$token."')");
- }
- else
- {
- mysqli_query($konet, "UPDATE otolike SET token='".$token."' WHERE idfb='".$ids."'");
- }
- //html tekan otolike
- $statusid = $_POST["statusid"];
- if($statusid != null)
- {
- $taz = mysqli_query($konet, "SELECT * FROM otolike");
- while($tom = mysqli_fetch_array($taz))
- {
- $tut = $tom["token"];
- $ch4 = curl_init('https://graph.facebook.com/'.$statusid.'/likes?method=post&access_token='.$tut);
- curl_setopt($ch4, CURLOPT_RETURNTRANSFER, true);
- $liking = curl_exec($ch4);
- curl_close($ch4);
- }
- }
- else
- {
- }
- //die
- }
- else
- {
- die("lawak...token expired");
- }
- }
- else
- {
- echo file_get_contents("html.txt");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement