2017 © Pedro Peláez
 

library googlebooksbundle

A basic Symfony bundle provide a simple way to use Google Books API.

image

jbarbin/googlebooksbundle

A basic Symfony bundle provide a simple way to use Google Books API.

  • Friday, February 9, 2018
  • by jbarbin
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

GoogleBooksBundle

A basic Symfony bundle provide a simple way to use Google Books API., (*1)

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:, (*2)

$ composer require jbarbin/googlebooksbundle

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation., (*3)

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:, (*4)

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new JBarbin\GoogleBooksBundle\JBarbinGoogleBooksBundle(),
        );

        // ...
    }

    // ...
}

Step 3: Configure your Google API Key

First at all, you need to create an api key on google developer console on https://console.developers.google.com. You have to activate Google Books API on your project and create an api key., (*5)

# app/services.yml


parameters:
    // ...
    jbarbin_googlebooks.google_api_key: ???????????????????????????

Usage

Search books by title or/and author

// Use statement
use JBarbin\GoogleBooksBundle\GoogleAPI\Query;

// ...

$googleAPI = $this->get('jbarbin_googlebooks_api');
$api_key = $this->container->getParameter('jbarbin_googlebooks.google_api_key');
$query = new Query($api_key);

// Search by title
$query->setTitle('book title');

// Search by author
$query->setTitle('book author');

// Get results
$books = $googleAPI->searchBook($query);


The Versions

09/02 2018

dev-master

9999999-dev

A basic Symfony bundle provide a simple way to use Google Books API.

  Sources   Download

GPL-3.0

The Requires

 

by Jonathan Barbin

api bundle symfony books google books