Skip to content

Instantly share code, notes, and snippets.

@DrayChou
Last active December 23, 2016 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DrayChou/454633920488d6cc55c2802d1bb511c8 to your computer and use it in GitHub Desktop.
Save DrayChou/454633920488d6cc55c2802d1bb511c8 to your computer and use it in GitHub Desktop.
<?php
$file_id = "1XSE7fHxtV-etUze91fkbRKaZodDPmQx9G_6Kc8I9sPE";
$access_token = "ya29.Ci-9A9Ckkgr6hn7Uu2UdNOm8XxK20jHNu3VfDT9mV_LbR2LmCYSo4ced8DOuEZif1g";
$url = "https://drive.google.com/thumbnail?sz=w320&id=" . $file_id;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer " . $access_token,
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment