구글 API 튜토리얼 2 - ISBN으로 책정보 조회

1 개요[ | ]

구글 책 API 시작하기
구글 책 API 튜토리얼
구글 책 API 사용하여 ISBN으로 책정보 조회
  • 여기서는 기본으로 제공된 예제를 사용하지 않고 간단히 새로 만들어 본다.

2 사전 작업[ | ]

3 my_batch.php 작성[ | ]

  • my_batch.php 새로 만들어보자.
  • 물론 DeveloperKey는 자신의 것을 입력해야 함[1]
root@zetawiki:~# vi my_batch.php
<?php
require_once 'google-api/autoload.php';
 
$client = new Google_Client();
$client->setDeveloperKey("AIzaSyBDEuxz8GIb0K2df4_hjlMOQSU68npWYrA");
$service = new Google_Service_Books($client);
 
$volumes = $service->volumes->listVolumes("isbn:8996276553");
print_r($volumes);

4 테스트[ | ]

  • my_batch.php를 실행해보자.
root@zetawiki:~# php my_batch.php 
Google_Service_Books_Volumes Object
(
    [collection_key:protected] => items
    [internal_gapi_mappings:protected] => Array
        (
        )

    [itemsType:protected] => Google_Service_Books_Volume
    [itemsDataType:protected] => array
    [kind] => books#volumes
    [totalItems] => 1
    [modelData:protected] => Array
        (
            [items] => Array
                (
                    [0] => Array
                        (
                            [kind] => books#volume
                            [id] => i5XebwAACAAJ
                            [etag] => 3Diz3Ui7Xek
                            [selfLink] => https://www.googleapis.com/books/v1/volumes/i5XebwAACAAJ
                            [volumeInfo] => Array
                                (
                                    [title] => JQUERY 쿡북(실전)(초이스 시리즈 2)
                                    [authors] => Array
                                        (
                                            [0] => JQUERY 코어커뮤니티
                                        )

                                    [publishedDate] => 2010-07-01
                                    [industryIdentifiers] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [type] => ISBN_10
                                                    [identifier] => 8996276553
                                                )

                                            [1] => Array
                                                (
                                                    [type] => ISBN_13
                                                    [identifier] => 9788996276555
... (생략)

5 같이 보기[ | ]

6 주석[ | ]

  1. 소스코드에 포함된 DeveloperKey는 엉터리 값이므로 제대로 실행되지 않습니다...

7 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}