Advertisement
Guest User

otolike send to bosq

a guest
Jun 1st, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.83 KB | None | 0 0
  1. <?php
  2. set_time_limit(0);
  3. header('content-type: text/plain');
  4. error_reporting(E_ALL);
  5. ini_set('display_errors', 'On');
  6. $username = "username lo";
  7. $password = "passlo";
  8.  
  9. $ch = curl_init();
  10. curl_setopt_array($ch, array(
  11.     CURLOPT_URL => "https://m.facebook.com",
  12.     CURLOPT_SSL_VERIFYPEER => false,
  13.     CURLOPT_RETURNTRANSFER => true,
  14.     CURLOPT_HEADER => true,
  15.     CURLOPT_COOKIEJAR => "facebook.cookiejar",
  16.     CURLOPT_COOKIEFILE => "facebook.cookiejar",
  17.     CURLOPT_FOLLOWLOCATION => true,
  18.     CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0"
  19. ));
  20. $response = curl_exec($ch);
  21. preg_match("/<form(.*?)<\/form>/", $response, $form);
  22. curl_close($ch);
  23.  
  24. $form = $form[0];
  25. $post = "";
  26. preg_match_all("/name=\"(.*?)\"(.*?)value=\"(.*?)\"/", $form, $data);
  27.  
  28. if($data[1][0] == "refid") {
  29.     goto home;
  30. }
  31.  
  32. $pass = false;
  33. for($i = 0; $i < count($data[0]); $i++)
  34. {
  35.     preg_match("/value=\"(.*?)\"/", $data[0][$i], $value);
  36.     preg_match("/name=\"(.*?)\"/", $data[0][$i], $name);
  37.     if($name[1] == "email") {
  38.         $value[1] = $username;
  39.     } else if($name[1] == "pass") {
  40.         $value[1] = $password;
  41.         $pass = true;
  42.     } else if($name[1] == "timezone") {
  43.         $value[1] = date_default_timezone_get();
  44.     }
  45.     $post .= $name[1] . "=" . urlencode($value[1]);
  46.     if($i != count($data[0]) -1) {
  47.         $post .= "&";
  48.     }
  49. }
  50.  
  51. if(!$pass) {
  52.     $post .= "&pass={$password}";
  53. }
  54.  
  55. $ch2 = curl_init();
  56. curl_setopt_array($ch2, array(
  57.     CURLOPT_URL => "https://m.facebook.com/login.php?refsrc=https%3A%2F%2Fm.facebook.com%2F&lwv=100&login_try_number=1&refid=8",
  58.     CURLOPT_SSL_VERIFYPEER => false,
  59.     CURLOPT_RETURNTRANSFER => true,
  60.     CURLOPT_HEADER => TRUE,
  61.     CURLOPT_POST => true,
  62.     CURLOPT_POSTFIELDS => $post,
  63.     CURLOPT_COOKIEJAR => "facebook.cookiejar",
  64.     CURLOPT_COOKIEFILE => "facebook.cookiejar",
  65.     CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0",
  66.     CURLOPT_FOLLOWLOCATION => TRUE
  67. ));
  68.  
  69. $response2 = curl_exec($ch2);
  70. curl_close($ch2);
  71.  
  72. preg_match("/<a href=\"\/reactions\/picker\/(.*?)\">/", $response2, $react_detail);
  73.  
  74.  
  75. home:
  76.  
  77. $ch2 = curl_init();
  78. curl_setopt_array($ch2, array(
  79.     CURLOPT_URL => "https://m.facebook.com/",
  80.     CURLOPT_SSL_VERIFYPEER => false,
  81.     CURLOPT_RETURNTRANSFER => true,
  82.     CURLOPT_HEADER => TRUE,
  83.     CURLOPT_COOKIEJAR => "facebook.cookiejar",
  84.     CURLOPT_COOKIEFILE => "facebook.cookiejar",
  85.     CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0",
  86.     CURLOPT_FOLLOWLOCATION => TRUE
  87. ));
  88.  
  89. $response2 = curl_exec($ch2);
  90. curl_close($ch2);
  91. preg_match_all("/<a href=\"\/reactions\/picker\/(.*?)\">/", $response2, $react_detail);
  92.  
  93. for($i = 0; $i < count($react_detail[0]); $i++) {
  94.     preg_match("/href=\"(.*?)\"/", $react_detail[0][$i], $react_link);
  95.     $react_link[1] = "https://m.facebook.com" . $react_link[1];
  96.  
  97.     $ch3 = curl_init();
  98.     curl_setopt_array($ch3, array(
  99.         CURLOPT_URL => $react_link[1],
  100.         CURLOPT_SSL_VERIFYPEER => false,
  101.         CURLOPT_HEADER => true,
  102.         CURLOPT_RETURNTRANSFER => true,
  103.         CURLOPT_COOKIEJAR => "facebook.cookiejar",
  104.         CURLOPT_COOKIEFILE => "facebook.cookiejar",
  105.         CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0"
  106.     ));
  107.  
  108.     $response = curl_exec($ch3);
  109.     curl_close($ch3);
  110.  
  111.     preg_match_all("/<a href=\"\/ufi\/reaction\/(.*?)\"/", $response, $reaction);
  112.     $react = "https://m.facebook.com/ufi/reaction/" . html_entity_decode($reaction[1][2]);
  113.     $ch4 = curl_init();
  114.     curl_setopt_array($ch4, array(
  115.         CURLOPT_URL => $react,
  116.         CURLOPT_SSL_VERIFYPEER => false,
  117.         CURLOPT_RETURNTRANSFER => true,
  118.         CURLOPT_HEADER => true,
  119.         CURLOPT_COOKIEJAR => "facebook.cookiejar",
  120.         CURLOPT_COOKIEFILE => "facebook.cookiejar",
  121.         CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0"
  122.     ));
  123.  
  124.     echo curl_exec($ch4);
  125.     curl_close($ch4);
  126.     echo PHP_EOL . PHP_EOL;
  127. }
  128. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement