https://developers.google.com/books/docs/v1/using
https://jonathanmh.com/searching-google ... uickstart/
Code: Select all
https://www.googleapis.com/books/v1/volumes?q=isbn:<your_isbn_here>
https://www.googleapis.com/books/v1/vol ... 0735619670
Code: Select all
https://www.googleapis.com/books/v1/volumes?q=isbn:<your_isbn_here>
Code: Select all
function getBookDetails(isbn) {
// Query the book database by ISBN code.
isbn = isbn || "9781451648546"; // Steve Jobs book
var url = "https://www.googleapis.com/books/v1/volumes?q=isbn:" + isbn;
var response = UrlFetchApp.fetch(url);
var results = JSON.parse(response);
if (results.totalItems) {
// There'll be only 1 book per ISBN
var book = results.items[0];
var title = (book["volumeInfo"]["title"]);
var subtitle = (book["volumeInfo"]["subtitle"]);
var authors = (book["volumeInfo"]["authors"]);
var printType = (book["volumeInfo"]["printType"]);
var pageCount = (book["volumeInfo"]["pageCount"]);
var publisher = (book["volumeInfo"]["publisher"]);
var publishedDate = (book["volumeInfo"]["publishedDate"]);
var webReaderLink = (book["accessInfo"]["webReaderLink"]);
// For debugging
Logger.log(book);
}
}
Code: Select all
$url = 'http://example.com/image.php';
$img = '/my/folder/flower.gif';
file_put_contents($img, file_get_contents($url));
Code: Select all
$ch = curl_init('http://example.com/image.php');
$fp = fopen('/my/folder/flower.gif', 'wb');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);