Advertisement
Guest User

Meh Face Auto Clicker

a guest
Jan 19th, 2017
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.16 KB | None | 0 0
  1. <?php
  2.         $username = "yourusername";
  3.         $password = "yourpassword";
  4.         $url = "https://mediocre.com/account/signin?client_id=meh.com&returnurl=https%3A%2F%2Fmeh.com%2F";
  5.         $cookie= "cookies.txt";
  6.         $ch = curl_init();
  7.         curl_setopt($ch, CURLOPT_URL, $url);
  8.         curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
  9.         curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
  10.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  11.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  12.         $response = curl_exec($ch);
  13.  
  14.         if (curl_errno($ch)) die(curl_error($ch));
  15.  
  16.  
  17.         $dom = new DomDocument();
  18.         $dom->loadHTML($response);
  19.         $tokens = $dom->getElementsByTagName("input");
  20.         for ($i = 0; $i < $tokens->length; $i++)
  21.                 {
  22.                     $meta = $tokens->item($i);
  23.                     if($meta->getAttribute('name') == '_csrf')
  24.                     $token = $meta->getAttribute('value');
  25.                 }
  26.  
  27.         $postinfo = "user=".$username."&password=".$password."&_csrf=".$token;
  28.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  29.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  30.         curl_setopt($ch, CURLOPT_POST, true);
  31.         curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
  32.         curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
  33.         curl_setopt($ch, CURLOPT_POSTFIELDS, $postinfo);
  34.         $html = curl_exec($ch);
  35.  if (curl_errno($ch)) print curl_error($ch);
  36.  
  37.                 $dom = new DomDocument();
  38.                 $dom->loadHTML($html);
  39.                 $tokens = $dom->getElementsByTagName("input");
  40.                 for ($i = 0; $i < $tokens->length; $i++)
  41.                 {
  42.                     $meta = $tokens->item($i);
  43.                     if($meta->getAttribute('name') == '_csrf') {
  44.                             $csrf = $meta->getAttribute('value');
  45.                         }
  46.                 }
  47.                 $tokens = $dom->getElementsByTagName("form");
  48.                 for ($i = 0; $i < $tokens->length; $i++)
  49.                 {
  50.                     $meta = $tokens->item($i);
  51.                     if($meta->getAttribute('method') == 'post') {
  52.                                 $token = $meta->getAttribute('action');
  53.                                 if (strpos($token,'deals') !== false) {
  54.                                         curl_setopt($ch, CURLOPT_URL, 'https://meh.com' . $token);
  55.                                         $postinfo = "_csrf=".$csrf;
  56.                                         curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  57.                                         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  58.                                         curl_setopt($ch, CURLOPT_POST, true);
  59.                                         curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
  60.                                         curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
  61.                                         curl_setopt($ch, CURLOPT_POSTFIELDS, $postinfo);
  62.                                         $html = curl_exec($ch);
  63.                                 }
  64.                    }
  65.                 }
  66.  
  67.         curl_close($ch);
  68.         unlink($cookie);
  69. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement