Advertisement
Guest User

Untitled

a guest
Jul 9th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1.     function puzzl($token,$code){
  2.         $ch = curl_init();
  3.         //curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
  4.         curl_setopt($ch, CURLOPT_URL, "https://lichess.org/api/user/puzzle-activity");
  5.  
  6.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  7.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  8.         $authorization = "Authorization: Bearer ".$token; // Prepare the authorisation token
  9.         curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-ndjson' , $authorization ));
  10.  
  11.         $data = curl_exec($ch);
  12.  
  13.         var_dump($data);
  14.        
  15.         curl_close($ch);
  16.         unset($ch);
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement