This is the unofficial ruby wrapper to the Yummly API, "the world's largest and most powerful recipe search site".
Still in the baking phase. Tests are being written, lots of churn at the moment.
Add this line to your application's Gemfile:
gem 'yummly'
And then execute:
$ bundle
Or install it yourself as:
$ gem install yummly
First, configure Yummly with your APP key and ID, for example in an initializer if you're using Rails:
Yummly.configure do |config|
config.app_id = "21334"
config.app_key = "XXXXXXXXXXXXXXXXX"
config.use_ssl = true # Default is false
end
Note: HTTPS API access is only available on some paid Yummly plans.
Once configured, you have access to two API calls:
The search command returns an array of Yummly::Recipe objects:
Yummly.search('Onion soup')
The find command returns a single Yummly::Recipe object:
Yummly.find('French-Onion-Soup-The-Pioneer-Woman-Cooks-_-Ree-Drummond-41364')
The Yummly ruby wrapper returns all results as recipe objects. These objects normalize the API responses to make it easier for developers to interact with recipes from ruby. All Yummly recipe attributes have been directly mapped. In cases where the JSON response returned an array for a specific attribute, an array of appropriate objects are returned from the ruby Recipe object.
For example, to access the thumbnail image for a recipe:
recipe = Yummly.find('French-Onion-Soup-The-Pioneer-Woman-Cooks-_-Ree-Drummond-41364')
recipe.images.first.small_url
(Shhhh, there's also a Recipe#thumbnail convenience method!)
Explore the Yummly::Recipe class to see the full range of available attributes.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request