Advertisement
alexx876

Untitled

May 19th, 2019
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.13 KB | None | 0 0
  1. <?php
  2. $session = 'SESSeb75810f03a0895d9ff136a416f45948=lFWNVIgQqUDCx3lsoHwGMzwl9_ap_KT19gowYhKNDdQ; SSESSeb75810f03a0895d9ff136a416f45948=IUepjG1YGE8UM6k2DJdR63ctYe4qx_clAimFzm0hyZk';
  3.  
  4. $curl = curl_init();
  5.  
  6. curl_setopt_array($curl, array(
  7.   CURLOPT_URL => "https://likest.ru/like.php",
  8.   CURLOPT_RETURNTRANSFER => true,
  9.   CURLOPT_ENCODING => "",
  10.   CURLOPT_MAXREDIRS => 10,
  11.   CURLOPT_TIMEOUT => 30,
  12.   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  13.   CURLOPT_CUSTOMREQUEST => "GET",
  14.   CURLOPT_POSTFIELDS => "",
  15.   CURLOPT_HTTPHEADER => array(
  16.     "Accept: */*",
  17.     "Cache-Control: no-cache",
  18.     "Connection: keep-alive",
  19.     "Host: likest.ru",
  20.     "User-Agent: PostmanRuntime/7.11.0",
  21.     "accept-encoding: gzip, deflate",
  22.     "cache-control: no-cache",
  23.     "cookie: ".$session
  24.   ),
  25. ));
  26.  
  27. $response = curl_exec($curl);
  28. $err = curl_error($curl);
  29.  
  30. curl_close($curl);
  31.  
  32. if ($err) {
  33.   echo "cURL Error #:" . $err;
  34. } else {
  35.     preg_match('/(wall)(-{1})(\d+)_(\d+)/', $response, $matches);
  36.     if ($matches[0]) {
  37.         echo json_encode(['link' => 'https://vk.com/'.$matches[0]]);
  38.     } else {
  39.         echo json_encode(['error' => 1]);
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement