Last active
December 23, 2016 11:50
-
-
Save DrayChou/454633920488d6cc55c2802d1bb511c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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