cpliakas/bigoven-php

This package is abandoned and no longer maintained. No replacement package was suggested.

A PHP client library for the BigOven API

dev-master 2014-01-06 14:57 UTC

This package is not auto-updated.

Last update: 2020-01-20 03:44:44 UTC


README

Build Status Coverage Status Total Downloads Latest Stable Version

A PHP client library for the BigOven API.

Installation

BigOven API Client for PHP can be installed with Composer by adding it as a dependency to your project's composer.json file.

{
    "require": {
        "cpliakas/bigoven-php": "*"
    }
}

Please refer to Composer's documentation for more detailed installation and usage instructions.

Usage


require 'vendor/autoload.php';

// Instantiate the client class that consumes the API.
$bigOven = \BigOven\BigOvenClient::factory(array(
    'api_key'  => 'my-api-key',
    'username' => 'my-username',
    'password' => 'my-password',
));

// Get a recipe by ID and display the title.
$recipe = $bigOven->getRecipe('12345');
echo $recipe->title() . PHP_EOL;

// List the ingredients.
echo 'Ingredients: ' . PHP_EOL;
foreach ($recipe as $ingredient) {
  echo $ingredient->name() . PHP_EOL;
}

// Show the user who posted the recipe.
echo 'Posted by: ' . $recipe->poster()->userName() . PHP_EOL;

// Get a list of recipes that have "cheese" in the title.
$recipes = $bigOven->findRecipesByTitle('cheese');