Project

punchfork

0.0
No commit activity in last 3 years
No release in over 3 years
A simple Ruby library for searching food recipes with punchfork.com
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

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 punchfork.com/api#apidocs

Due to a lack of support of 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 # recipe.secure_thumb # recipe.secure_url(recipe.thumb) #

Debugging¶ ↑

If you are not getting the response back you expect you can run your app in debug mode and check the logs: rails server PUNCHFORK_DEBUG=true

Contact¶ ↑

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

License¶ ↑

This project rocks and uses MIT-LICENSE.