책의 isbn 번호를 전달하여 책의 세부 사항을 얻기 위해이 코드를 manuplate하는 방법
$client = new \Google_Client();
$client->setApplicationName("BestBook");
$client->setAuthConfigFile('temp.json');
$client->addScope(\Google_Service_Drive::DRIVE);
$client->setDeveloperKey("AIzaSyD6OrKhhJiseBimFVJZ_7OV5tyPdg4LxZiY");
$service = new \Google_Service_Books($client);
$results = $service->volumes->listVolumes('Henry David Thoreau');
foreach ($results as $item) {
echo $item['volumeInfo']['imageLinks']['smallThumbnail'], "<br /> \n";
}
그리고 내가 1 isbn을 통과했을 때 왜 10 출력을 보여주는 지 알 수 있습니다.
Google 도서에서 ISBN_13 및 ISBN_10을 제공한다는 사실을 고려하세요. 이를 염두에두고 다음을 수행해야합니다.
$client = new Google_Client();
$client->setApplicationName("BestBook");
$client->setDeveloperKey("asdfkjeriuIEWURkjfaskd");
$optParams = array(
'filter' => 'ebooks'//,
//'langRestrict' => 'es',
//'orderBy' => 'relevance'
);
$isbnNumber = 9781452052656;
$results = $service->volumes->listVolumes($isbnNumber, $optParams);
// HANDLE RESULT
foreach ($results as $item) {
if ($item['volumeInfo']['industryIdentifiers'][0]['identifier'] == $isbnNumber ) { // For ISBN_13 (for ISBN_10 use $item['volumeInfo']['industryIdentifiers'][1]['identifier'] )
echo " - ".utf8_decode($item['volumeInfo']['title']), "<br />";
}
}
그런데, 이후 사용자 데이터에 액세스하지 않지만 대신 응용 프로그램 데이터 당신은 선을 사용할 필요가 없습니다 $client->addScope(\Google_Service_Drive::DRIVE);
및$client->setAuthConfigFile('temp.json');
오! 나는 거의 잊었다! 민감한 정보이므로 여기에 API 키를 게시하지 마십시오!
도움이 되었기를 바랍니다!
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다