Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Power Design on "Incorporating Google Books API with using ISBN and Custom Fields"

$
0
0

Hello,
My client wants to display some recommended books on their site. So far, I have my theme set up so that when my client enters the ISBN of the book into the Custom Field "ISBN" for a post, it will retrieve the cover image from Google Books. That worked for awhile, but now I believe I have reached my anonymous limit for using Google Books API, and need to incorporate the OAuth into the process. Is there a way to get my Client ID for Google Books API in the header.php? Or am I approaching this problem completely the wrong way?

I have no knowledge of making Plugins, but I can edit php files for Themes. This is how I am currently getting the book covers:

<div class="book-cover"><?php
$isbn = get_post_meta($post->ID, 'ISBN', true);
$page = file_get_contents("https://www.googleapis.com/books/v1/volumes?q=isbn:$isbn");
$data = json_decode($page, true);
$cover = $data['items'][0]['volumeInfo']['imageLinks']['thumbnail'];
echo "<img src='$cover' />";
?>
</div>

Any help with this is greatly appreciated!


Viewing all articles
Browse latest Browse all 8245

Trending Articles