Sha256: 73347f4534dfad0486a6f91292f014806960f0f311571aea31ee3bd10904a773

Contents?: true

Size: 1.37 KB

Versions: 2

Compression:

Stored size: 1.37 KB

Contents

= Punchfork

A simple Ruby library for searching recipes with punchfork.com

= Install
add it to your Gemfile:

 gem 'punchfork'

configure your API key in config/initializers/punchfork.rb

 Punchfork.setup do |config|
   config.api_key = 'your-api-key'
   config.protocol = 'https' # defaults to http
 end

= Usage

Search for recipes using ingredients:
  
 search = Punchfork.search(:garlic, :tomatoes)
 search.count # => 10
 search.recipes.length # => 10

Any options you pass to the search method will automatically be appended to the querystring sent to punchfork.com.
For example:
  search = Punchfork.search(:tomato, count:50)
  search.count # => 50

Check out the full set of options at http://punchfork.com/api#apidocs

Due to a lack of support images being served over https, I have implemented a rewrite method to do this for you in the Recipe object:
	recipe = search.recipes.first
	recipe.thumb # http://img.punchfork.net/f9c6047f7958927a0cff232e0da16853_250x250.jpg
	recipe.secure_thumb # https://s3.amazonaws.com/img.punchfork.net/f9c6047f7958927a0cff232e0da16853_250x250.jpg
	recipe.secure_url(recipe.thumb) # https://s3.amazonaws.com/img.punchfork.net/f9c6047f7958927a0cff232e0da16853_250x250.jpg

= Contact

If you have any issues or questions, please open a ticket through github: https://github.com/gabeodess/Punchfork/issues

= License

This project rocks and uses MIT-LICENSE.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
punchfork-0.0.6 README.rdoc
punchfork-0.0.5 README.rdoc