Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.00 KB | None | 0 0
  1. <?php
  2.  
  3. error_reporting(E_ALL);
  4. ini_set('display_errors', '1');
  5.  
  6.  
  7.  
  8. class like_posts
  9. {
  10.     const id ='';
  11.  
  12.     public function token() {
  13.         if(isset($_POST['tokens']) && isset($_POST['profile_id'])){
  14.             global $tokens_array;
  15.             $tokens=htmlentities($_POST['tokens']);
  16.             $profile_id=htmlentities($_POST['profile_id']);
  17.             $tokens_array = explode(',', $tokens);
  18.  
  19.             $response = array();
  20.  
  21.             if(!empty($tokens_array)) {
  22.                 foreach($tokens_array  as $token) {
  23.                     $response[] = $this->check_post($token, $profile_id);
  24.                 }
  25.             }
  26.  
  27.             return $response;
  28.         }
  29.     }
  30.  
  31.     public function check_post($token,$profile_id)
  32.     {
  33.         $url = file_get_contents("https://graph.facebook.com/$profile_id/feed?fields=id&access_token=$token");
  34.         $Json = json_decode($url, true);
  35.  
  36.         $id = $Json['data']['0']['id'];
  37.         $profile_id = $profile_id . '_';
  38.  
  39.         $post_id = str_replace($profile_id, '', $id); //income
  40.  
  41.         if($post_id != self::id) {
  42.             return [
  43.                 'id' => $post_id,
  44.                 'updated' => true,
  45.             ];
  46.         } else {
  47.             return [
  48.                 'id' => $post_id,
  49.                 'updated' => false,
  50.             ];
  51.         }
  52.     }
  53. }
  54.  
  55. $run = new like_posts;
  56.  
  57. print '<pre>';
  58. print_r($run->token());
  59. print '</pre>';
  60.  
  61.  
  62.  
  63.  
  64. ?>
  65. <html>
  66. <body>
  67. <center>
  68.     <font size="6" color="white"  style="text-shadow: 3px 3px 4px  black;"><b> [+]Like posts[+]</b></font><br><br>
  69.     <form action="" method="POST">
  70.         <textarea id = "domainlist" name = "tokens" cols="40" rows="6" placeholder="Token"><?php echo !empty($_POST['tokens']) ? $_POST['tokens'] : null; ?></textarea><br>
  71.         Profile id: <input type="text" name="profile_id" value="<?php echo !empty($_POST['profile_id']) ? $_POST['profile_id'] : null; ?>"><br>
  72.         <input type="submit" value="Submit">
  73.     </form>
  74. </center>
  75. </body>
  76. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement