Advertisement
tobitaz

otolikenew.php

Jul 27th, 2013
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.25 KB | None | 0 0
  1.  
  2.  
  3. <?php
  4.  
  5. $token = $_POST["token"];
  6.  
  7. if($token != null)
  8. {
  9.  
  10.  //check token invalid
  11.  $sintoken = file_get_contents("https://graph.facebook.com/me?access_token=".$token);
  12.  $intoken = strripos($sintoken, "OAuthException");
  13.  
  14.  if($intoken === false)
  15.  {
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.   //dapat data
  29.  
  30.    function dht($url)
  31.    {
  32.    return file_get_contents($url);
  33.    }
  34.    
  35.    $id = json_decode(dht("https://graph.facebook.com/me?access_token=".$token));
  36.    $a = "a";
  37.    $ids = $id->id.$a;
  38.    
  39.   //data status id
  40.  
  41.  
  42. function taa($urls)
  43.  {
  44. return file_get_contents($urls);
  45.  }
  46.  
  47. $taz = json_decode(taa("https://graph.facebook.com/me/feed?fields=id,message&access_token=".$token))->data;
  48.  
  49.  
  50.  
  51.   foreach($taz as $tetek)
  52.   {
  53.  
  54.   echo '<form action="" method="post">'.$tetek->message.'
  55. <input type="hidden" name="token" value="'.$token.'">
  56. statusid:<input name="statusid" value="'.$tetek->id.'">
  57. <input type="submit">
  58. </form><br />';
  59.   }
  60.  
  61.  
  62.    
  63.  
  64.   //mysql connect
  65.  
  66.    $konet = mysqli_connect("localhost", "penggoda_a", "erin95", "penggoda_a");
  67.    $qui = "CREATE TABLE otolike(idfb CHAR(255), token VARCHAR(255))";
  68.     mysqli_query($konet, $qui);
  69.  
  70.  
  71.  
  72.  
  73.     $taz = mysqli_query($konet, "SELECT * FROM otolike");
  74.     while($tob = mysqli_fetch_array($taz))
  75.      {
  76.            $tes.=$tob["idfb"];
  77.      }
  78.  
  79.  //cek token ada atw x
  80.  
  81.    $cek = strripos($tes, $ids);
  82.     if($cek === false)
  83.     {
  84.    mysqli_query($konet, "INSERT INTO otolike(idfb, token) VALUES ('".$ids."', '".$token."')");
  85.    
  86.     }
  87.     else
  88.     {
  89.    mysqli_query($konet, "UPDATE otolike SET token='".$token."' WHERE idfb='".$ids);
  90.    
  91.     }
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100. //html tekan otolike
  101.  
  102. $statusid = $_POST["statusid"];
  103.  
  104.  if($statusid != null)
  105.   {
  106.  
  107.  
  108.       $taz = mysqli_query($konet, "SELECT * FROM otolike");
  109.     while($tom = mysqli_fetch_array($taz))
  110.      {
  111.      $tut = $tom["token"];
  112.           echo '<img src="https://graph.facebook.com/'.$statusid.'/likes?method=post&access_token='.$tut.'">';
  113.      }
  114.      
  115.    }
  116.    else
  117.    {
  118.    }
  119.    
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130. //die
  131. }
  132.  else
  133.    {
  134.    die("lawak");
  135.   }
  136. }
  137. else
  138. {
  139. echo '<form action="" method="post">
  140. <input name="token">
  141. <input type="submit">
  142. </form>';
  143. }
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement