mpaa_rating) < 2) { $rating = 'No rating available.'; } else { $rating = $item->mpaa_rating; } //assign value for title of page $pageTitle = 'Search Books: Google Books Search API'; $subTitle = 'MSU Libraries'; //declare filename for additional stylesheet variable - default is "none" $customCSS = 'master.css'; //create an array with filepaths for multiple page scripts - default is meta/scripts/global.js $customScript[0] = './meta/scripts/global.js'; ?> <?php echo($pageTitle); ?> : Montana State University Libraries '."\n"; } } ?>

: (Querying Google Books)

You must specify a search type such as "all" or "book". Check the url to make sure "type=" has a value.

'; exit; } if(isset($_GET['q'])): //if Google Books Search API has been queried using the form echo '

Try another search?

'."\n"; //set URL for the Google Book Search API $url = 'https://www.googleapis.com/books/v'.$v.'/volumes?key='.$key.'&userIp='.$ip.'&'.$params.''; //build request and send to Google Ajax Search API $request = file_get_contents($url); //decode json object(s) out of response from Google Ajax Search API $data = json_decode($request,true); $totalItems = $data['totalItems']; //make sure some results were returned, show results as html with result numbering and pagination if ($totalItems > 0) { ?>

Results of your Google Books "" search for "" (About matches)

1) { $next = $start + 10; $previous = $start - 10; ?> = $totalItems) { $previous = $start - 10; ?> no more results

Sorry, there were no results

API request: '.$apiRequest.'

'; ?>