punchr 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/.rspec +2 -0
- data/.rvmrc +1 -0
- data/CHANGELOG.markdown +3 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +20 -0
- data/README.markdown +63 -0
- data/Rakefile +12 -0
- data/lib/punchr.rb +10 -0
- data/lib/punchr/client.rb +82 -0
- data/lib/punchr/configuration.rb +18 -0
- data/lib/punchr/version.rb +3 -0
- data/punchr.gemspec +27 -0
- data/spec/cassettes/diet_index.json +1 -0
- data/spec/cassettes/publishers.json +1 -0
- data/spec/cassettes/random_recipe.json +1 -0
- data/spec/cassettes/rate_limit_status.json +1 -0
- data/spec/cassettes/recipes.json +1 -0
- data/spec/cassettes/search_index.json +1 -0
- data/spec/punchr/client_spec.rb +70 -0
- data/spec/punchr/configuration_spec.rb +13 -0
- data/spec/spec_helper.rb +15 -0
- metadata +162 -0
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use --create ruby-1.9.3@punchr_gem
|
data/CHANGELOG.markdown
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2012 David Czarnecki
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# punchr
|
2
|
+
|
3
|
+
Ruby gem for interacting with the [Punchfork API](http://punchfork.com/api).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
`gem install punchr`
|
8
|
+
|
9
|
+
or in your `Gemfile`
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'punchr'
|
13
|
+
```
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
Configure punchr with your API key:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
require 'punchr'
|
21
|
+
|
22
|
+
Punchr.api_key = 'this-is-your-punchfork-api-key'
|
23
|
+
```
|
24
|
+
|
25
|
+
or configure as:
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
Punchr.configure do |configuration|
|
29
|
+
configuration.api_key = 'this-is-your-punchfork-api-key'
|
30
|
+
end
|
31
|
+
```
|
32
|
+
|
33
|
+
```
|
34
|
+
client = Punchr::Client.new
|
35
|
+
|
36
|
+
response = client.recipes(:q => 'meatballs')
|
37
|
+
|
38
|
+
response = client.random_recipe
|
39
|
+
|
40
|
+
response = client.publishers
|
41
|
+
|
42
|
+
response = client.diet_index('2 cups yellow cornmeal\n2 teaspoons baking powder\n3/4 to 1 teaspoon fine sea salt\n1 large egg, lightly beaten\n1 cup water, plus more if needed\n1/4 to 1/3 cup mild-flavored vegetable oil for frying') # Premium API call
|
43
|
+
|
44
|
+
response = client.search_index(:title => 'Chicken Parmigiana', :ingred => '1 egg, beaten\n2 ounces dry bread crumbs\n2 skinless, boneless chicken breast halves\n3/4 (16 ounce) jar spaghetti sauce\n2 ounces shredded mozzarella cheese\n1/4 cup grated Parmesan cheese') # Ultra API call
|
45
|
+
|
46
|
+
response = client.rate_limit_status
|
47
|
+
```
|
48
|
+
|
49
|
+
You can find more details on the [Punchfork API](http://punchfork.com/api#apidocs) at their site.
|
50
|
+
|
51
|
+
## Contributing to punchr
|
52
|
+
|
53
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
54
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
55
|
+
* Fork the project
|
56
|
+
* Start a feature/bugfix branch
|
57
|
+
* Commit and push until you are happy with your contribution
|
58
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
59
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
60
|
+
|
61
|
+
## Copyright
|
62
|
+
|
63
|
+
Copyright (c) 2012 David Czarnecki. See LICENSE.txt for further details.
|
data/Rakefile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
require 'rake'
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
|
6
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
7
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
8
|
+
spec.rspec_opts = ['--backtrace']
|
9
|
+
# spec.ruby_opts = ['-w']
|
10
|
+
end
|
11
|
+
|
12
|
+
task :default => :spec
|
data/lib/punchr.rb
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'typhoeus'
|
3
|
+
|
4
|
+
module Punchr
|
5
|
+
class Client
|
6
|
+
# Recipe search.
|
7
|
+
#
|
8
|
+
# @param options [Hash] For details on valid options see http://punchfork.com/api.
|
9
|
+
# @return Search results matching the input options.
|
10
|
+
def recipes(options = {})
|
11
|
+
JSON.parse(Typhoeus::Request.get(
|
12
|
+
api_url('recipes'),
|
13
|
+
:headers => {'User-Agent' => Punchr::USER_AGENT_HEADER},
|
14
|
+
:params => options.dup.merge({:key => Punchr.api_key})
|
15
|
+
).body)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Retrieve a single recipe selected at random from the Punchfork database.
|
19
|
+
#
|
20
|
+
# @return A single recipe selected at random from the Punchfork database.
|
21
|
+
def random_recipe
|
22
|
+
JSON.parse(Typhoeus::Request.get(
|
23
|
+
api_url('random_recipe'),
|
24
|
+
:headers => {'User-Agent' => Punchr::USER_AGENT_HEADER},
|
25
|
+
:params => {:key => Punchr.api_key}
|
26
|
+
).body)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Retrieve all recipe publishers on Punchfork.
|
30
|
+
#
|
31
|
+
# @return All recipe publishers on Punchfork.
|
32
|
+
def publishers
|
33
|
+
JSON.parse(Typhoeus::Request.get(
|
34
|
+
api_url('publishers'),
|
35
|
+
:headers => {'User-Agent' => Punchr::USER_AGENT_HEADER},
|
36
|
+
:params => {:key => Punchr.api_key}
|
37
|
+
).body)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Generate an array of diet terms describing which diets are safe for the input recipe ingredients.
|
41
|
+
#
|
42
|
+
# @param ingredients [String] Recipe ingredients, as a newline-separated list. Also see http://punchfork.com/api.
|
43
|
+
# @return An array of diet terms describing which diets are safe for the input recipe ingredients.
|
44
|
+
def diet_index(ingredients)
|
45
|
+
JSON.parse(Typhoeus::Request.post(
|
46
|
+
api_url('diet_index'),
|
47
|
+
:headers => {'User-Agent' => Punchr::USER_AGENT_HEADER},
|
48
|
+
:params => {:key => Punchr.api_key, :ingredients => ingredients}
|
49
|
+
).body)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Generate search index terms for the input recipe. Also see http://punchfork.com/api.
|
53
|
+
#
|
54
|
+
# @param title [String] Recipe title.
|
55
|
+
# @param ingredients [String] Recipe ingredients, as a newline-separated list.
|
56
|
+
# @return Search index terms for the input recipe.
|
57
|
+
def search_index(title, ingredients)
|
58
|
+
JSON.parse(Typhoeus::Request.post(
|
59
|
+
api_url('search_index'),
|
60
|
+
:headers => {'User-Agent' => Punchr::USER_AGENT_HEADER},
|
61
|
+
:params => {:key => Punchr.api_key, :title => title, :ingredients => ingredients}
|
62
|
+
).body)
|
63
|
+
end
|
64
|
+
|
65
|
+
# Retrieve the number of remaining API calls allowed today for the given API key.
|
66
|
+
#
|
67
|
+
# @return The number of remaining API calls allowed today for the given API key.
|
68
|
+
def rate_limit_status
|
69
|
+
JSON.parse(Typhoeus::Request.get(
|
70
|
+
api_url('rate_limit_status'),
|
71
|
+
:headers => {'User-Agent' => Punchr::USER_AGENT_HEADER},
|
72
|
+
:params => {:key => Punchr.api_key}
|
73
|
+
).body)
|
74
|
+
end
|
75
|
+
|
76
|
+
private
|
77
|
+
|
78
|
+
def api_url(api_endpoint)
|
79
|
+
"#{Punchr::API_URL}/#{api_endpoint}"
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Punchr
|
2
|
+
# Configuration settings for Punchr.
|
3
|
+
module Configuration
|
4
|
+
# API key.
|
5
|
+
attr_accessor :api_key
|
6
|
+
|
7
|
+
# Yield self to be able to configure Punchr with block-style configuration.
|
8
|
+
#
|
9
|
+
# Example:
|
10
|
+
#
|
11
|
+
# Punchr.configure do |configuration|
|
12
|
+
# configuration.api_key = 'your-punchr-api-key'
|
13
|
+
# end
|
14
|
+
def configure
|
15
|
+
yield self
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/punchr.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require 'punchr/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "punchr"
|
7
|
+
s.version = Punchr::VERSION
|
8
|
+
s.authors = ["David Czarnecki"]
|
9
|
+
s.email = ["me@davidczarnecki.com"]
|
10
|
+
s.homepage = "https://github.com/punchfork/punchr"
|
11
|
+
s.summary = "Ruby gem for interacting with the Punchfork API"
|
12
|
+
s.description = "Ruby gem for interacting with the Punchfork API"
|
13
|
+
|
14
|
+
s.rubyforge_project = "punchr"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.add_dependency('typhoeus')
|
22
|
+
|
23
|
+
s.add_development_dependency('rake')
|
24
|
+
s.add_development_dependency('rspec')
|
25
|
+
s.add_development_dependency('vcr')
|
26
|
+
s.add_development_dependency('multi_json')
|
27
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
{"http_interactions":[{"request":{"method":"post","uri":"https://api.punchfork.com/diet_index","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["punchr gem version 1.0.0"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Tue, 08 May 2012 01:21:43 GMT"],"Server":["Apache/2.2.22 (Unix) DAV/2 mod_wsgi/3.3 Python/2.7 mod_ssl/2.2.22 OpenSSL/0.9.8k"],"Vary":["Accept-Encoding"],"Content-Encoding":["gzip"],"Content-Length":["70"],"Content-Type":["application/json"]},"body":{"encoding":"ASCII-8BIT","string":"{\"diets\": [ \"gluten free\", \"vegetarian\" ]}"},"http_version":"1.1"},"recorded_at":"Tue, 08 May 2012 01:21:44 GMT"}],"recorded_with":"VCR 2.1.1"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"http_interactions":[{"request":{"method":"get","uri":"https://api.punchfork.com/publishers?key=this-is-your-api-key","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["punchr gem version 1.0.0"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Tue, 08 May 2012 00:58:07 GMT"],"Server":["Apache/2.2.22 (Unix) DAV/2 mod_wsgi/3.3 Python/2.7 mod_ssl/2.2.22 OpenSSL/0.9.8k"],"Vary":["Accept-Encoding"],"Content-Encoding":["gzip"],"Content-Length":["5314"],"Content-Type":["application/json"]},"body":{"encoding":"ASCII-8BIT","string":"{\n \"publishers\": [\n {\n \"name\": \"The Pioneer Woman\", \n \"twitter\": \"thepioneerwoman\", \n \"site\": \"www.thepioneerwoman.com\", \n \"num_recipes\": 463, \n \"avatar\": \"http://si0.twimg.com/profile_images/1277545293/pw_bigger_bigger_reasonably_small.jpg\", \n \"avg_rating\": 77.54868706652155\n }, \n {\n \"name\": \"Smitten Kitchen\", \n \"twitter\": \"smittenkitchen\", \n \"site\": \"smittenkitchen.com\", \n \"num_recipes\": 673, \n \"avatar\": \"http://si0.twimg.com/profile_images/63105938/smittenkitchenlogoclean.jpg\", \n \"avg_rating\": 74.50236297373469\n }, \n {\n \"name\": \"My Baking Addiction\", \n \"twitter\": \"bakingaddiction\", \n \"site\": \"www.mybakingaddiction.com\", \n \"num_recipes\": 199, \n \"avatar\": \"http://a2.twimg.com/profile_images/1048178026/Facebook-Button.jpg\", \n \"avg_rating\": 69.98212728606198\n }, \n {\n \"name\": \"101 Cookbooks\", \n \"twitter\": \"101Cookbooks\", \n \"site\": \"www.101cookbooks.com\", \n \"num_recipes\": 486, \n \"avatar\": \"http://si0.twimg.com/profile_images/98173548/heidi_twitter_reasonably_small.jpg\", \n \"avg_rating\": 66.79050178159189\n }, \n {\n \"name\": \"Simply Recipes\", \n \"twitter\": \"simplyrecipes\", \n \"site\": \"simplyrecipes.com\", \n \"num_recipes\": 1208, \n \"avatar\": \"http://si2.twimg.com/profile_images/1309724052/elise-twitter-apr-2011_reasonably_small.jpg\", \n \"avg_rating\": 64.41666883675522\n }, \n {\n \"name\": \"Skinny Taste\", \n \"twitter\": \"Skinnytaste\", \n \"site\": \"www.skinnytaste.com\", \n \"num_recipes\": 616, \n \"avatar\": \"http://si0.twimg.com/profile_images/75550642/IMG_1605_reasonably_small.jpg\", \n \"avg_rating\": 61.76331593824508\n }, \n {\n \"name\": \"Sprouted Kitchen\", \n \"twitter\": \"sproutedkitchen\", \n \"site\": \"www.sproutedkitchen.com\", \n \"num_recipes\": 109, \n \"avatar\": \"http://a3.twimg.com/profile_images/1177271936/BALI_2010_0629_copy_bigger.jpg\", \n \"avg_rating\": 60.49786387819001\n }, \n {\n \"name\": \"David Lebovitz\", \n \"twitter\": \"davidlebovitz\", \n \"site\": \"www.davidlebovitz.com\", \n \"num_recipes\": 242, \n \"avatar\": \"http://si1.twimg.com/profile_images/1151453041/twitter_pic_reasonably_small.jpg\", \n \"avg_rating\": 56.40539300588557\n }, \n {\n \"name\": \"Steamy Kitchen\", \n \"twitter\": \"steamykitchen\", \n \"site\": \"steamykitchen.com\", \n \"num_recipes\": 306, \n \"avatar\": \"http://a3.twimg.com/profile_images/81027243/jaden_covershot_web_small_1x1_reasonably_small.jpg\", \n \"avg_rating\": 52.911738516277445\n }, \n {\n \"name\": \"Gluten Free Goddess\", \n \"twitter\": \"KarinaAllrich\", \n \"site\": \"glutenfreegoddess.blogspot.com\", \n \"num_recipes\": 327, \n \"avatar\": \"http://a2.twimg.com/profile_images/1263010357/Gluten-Free-Goddess-Karina-AllrichSQ_bigger.jpg\", \n \"avg_rating\": 51.13780025959921\n }, \n {\n \"name\": \"Michael Ruhlman\", \n \"twitter\": \"ruhlman\", \n \"site\": \"ruhlman.com\", \n \"num_recipes\": 100, \n \"avatar\": \"http://a1.twimg.com/profile_images/75057929/MR_300_for_Ratio_2_reasonably_small.jpg\", \n \"avg_rating\": 49.23703166771892\n }, \n {\n \"name\": \"Not Without Salt\", \n \"twitter\": \"AshleyRodriguez\", \n \"site\": \"notwithoutsalt.com\", \n \"num_recipes\": 115, \n \"avatar\": \"http://twimg0-a.akamaihd.net/profile_images/1983003774/headshot.jpg\", \n \"avg_rating\": 48.979696843161896\n }, \n {\n \"name\": \"Joy the Baker\", \n \"twitter\": \"joythebaker\", \n \"site\": \"joythebaker.com\", \n \"num_recipes\": 410, \n \"avatar\": \"http://twimg0-a.akamaihd.net/profile_images/1364106328/Screen_shot_2011-05-21_at_10.01.48_PM_reasonably_small.png\", \n \"avg_rating\": 48.583442475541325\n }, \n {\n \"name\": \"Smith Bites\", \n \"twitter\": \"smithbites\", \n \"site\": \"www.smithbites.com\", \n \"num_recipes\": 66, \n \"avatar\": \"http://a1.twimg.com/profile_images/1204829010/smithbites_new5_reasonably_small.png\", \n \"avg_rating\": 48.3075907644656\n }, \n {\n \"name\": \"The Amateur Gourmet\", \n \"twitter\": \"amateurgourmet\", \n \"site\": \"www.amateurgourmet.com\", \n \"num_recipes\": 88, \n \"avatar\": \"http://a2.twimg.com/profile_images/1156705091/adam_reasonably_small.jpg\", \n \"avg_rating\": 46.4971948770044\n }, \n {\n \"name\": \"The Kitchn\", \n \"twitter\": \"thekitchn\", \n \"site\": \"www.thekitchn.com\", \n \"num_recipes\": 1110, \n \"avatar\": \"http://twimg0-a.akamaihd.net/profile_images/1742326325/WhiteonYellow.jpg\", \n \"avg_rating\": 45.434868195693\n }, \n {\n \"name\": \"Picky Palate\", \n \"twitter\": \"pickypalate\", \n \"site\": \"picky-palate.com\", \n \"num_recipes\": 328, \n \"avatar\": \"http://a0.twimg.com/profile_images/808425090/IMG_4630smhd_reasonably_small.jpg\", \n \"avg_rating\": 45.21951013271781\n }, \n {\n \"name\": \"Rasa Malaysia\", \n \"twitter\": \"rasamalaysia\", \n \"site\": \"rasamalaysia.com\", \n \"num_recipes\": 414, \n \"avatar\": \"http://a3.twimg.com/profile_images/620561520/BeeYinnLow_reasonably_small.jpg\", \n \"avg_rating\": 45.20920122029868\n }, \n {\n \"name\": \"Two Peas & Their Pod\", \n \"twitter\": \"TwoPeasandPod\", \n \"site\": \"www.twopeasandtheirpod.com\", \n \"num_recipes\": 462, \n \"avatar\": \"http://si0.twimg.com/profile_images/1303630846/me_reasonably_small.jpg\", \n \"avg_rating\": 44.77827764374152\n }, \n {\n \"name\": \"A Spicy Perspective\", \n \"twitter\": \"spicyperspectiv\", \n \"site\": \"aspicyperspective.com\", \n \"num_recipes\": 166, \n \"avatar\": \"http://si0.twimg.com/profile_images/1637431928/IMG_8771_reasonably_small.jpg\", \n \"avg_rating\": 43.4159089269453\n }, \n {\n \"name\": \"La Fuji Mama\", \n \"twitter\": \"fujimama\", \n \"site\": \"www.lafujimama.com\", \n \"num_recipes\": 170, \n \"avatar\": \"http://si0.twimg.com/profile_images/1127365014/LFM_Twitter_reasonably_small.jpg\", \n \"avg_rating\": 43.18020663006329\n }, \n {\n \"name\": \"The Shiksa in the Kitchen\", \n \"twitter\": \"theshiksa\", \n \"site\": \"theshiksa.com\", \n \"num_recipes\": 202, \n \"avatar\": \"http://a0.twimg.com/profile_images/1283139926/shiksa_twitter_avatar_reasonably_small.jpg\", \n \"avg_rating\": 42.96338377905331\n }, \n {\n \"name\": \"Good Life Eats\", \n \"twitter\": \"goodlifeeats\", \n \"site\": \"www.goodlifeeats.com\", \n \"num_recipes\": 251, \n \"avatar\": \"http://si0.twimg.com/profile_images/538626982/katieandmadeline_reasonably_small.jpg\", \n \"avg_rating\": 42.48417139413737\n }, \n {\n \"name\": \"Recipe Girl\", \n \"twitter\": \"recipegirl\", \n \"site\": \"www.recipegirl.com\", \n \"num_recipes\": 803, \n \"avatar\": \"http://si0.twimg.com/profile_images/1281802098/Lori_1_reasonably_small.jpg\", \n \"avg_rating\": 42.395047228679\n }, \n {\n \"name\": \"Leite's Culinaria\", \n \"twitter\": \"leitesculinaria\", \n \"site\": \"leitesculinaria.com\", \n \"num_recipes\": 1415, \n \"avatar\": \"http://si0.twimg.com/profile_images/929570470/mixer-mash_reasonably_small.jpg\", \n \"avg_rating\": 42.131229570648806\n }, \n {\n \"name\": \"Pinch My Salt\", \n \"twitter\": \"pinchmysalt\", \n \"site\": \"pinchmysalt.com\", \n \"num_recipes\": 174, \n \"avatar\": \"http://a3.twimg.com/profile_images/259136866/Small_extracted_cherries_reasonably_small.png\", \n \"avg_rating\": 41.89664795309451\n }, \n {\n \"name\": \"The Little Kitchen\", \n \"twitter\": \"thelittlekitchn\", \n \"site\": \"www.thelittlekitchen.net\", \n \"num_recipes\": 61, \n \"avatar\": \"http://a1.twimg.com/profile_images/1473312679/me_sav_sq_reasonably_small.jpg\", \n \"avg_rating\": 41.342798146208274\n }, \n {\n \"name\": \"Dashing Dish\", \n \"twitter\": \"dashingdish\", \n \"site\": \"www.dashingdish.com\", \n \"num_recipes\": 145, \n \"avatar\": \"http://www.dashingdish.com/wp-content/uploads/2011/06/newpic.jpg\", \n \"avg_rating\": 39.48349492480091\n }, \n {\n \"name\": \"Serious Eats\", \n \"twitter\": \"seriouseats\", \n \"site\": \"www.seriouseats.com\", \n \"num_recipes\": 3914, \n \"avatar\": \"http://cdn.punchfork.net.s3.amazonaws.com/se_logo_square110.jpg\", \n \"avg_rating\": 39.462980875116784\n }, \n {\n \"name\": \"Use Real Butter\", \n \"twitter\": \"userealbutter\", \n \"site\": \"userealbutter.com\", \n \"num_recipes\": 530, \n \"avatar\": \"http://a3.twimg.com/profile_images/1519031393/jenkaw_reasonably_small.jpg\", \n \"avg_rating\": 39.46139162145907\n }, \n {\n \"name\": \"Cannelle et Vanille\", \n \"twitter\": \"CannelleVanille\", \n \"site\": \"www.cannellevanille.com\", \n \"num_recipes\": 142, \n \"avatar\": \"http://si2.twimg.com/profile_images/1128590992/Aran_photo_reasonably_small.jpg\", \n \"avg_rating\": 39.32773413050425\n }, \n {\n \"name\": \"Closet Cooking\", \n \"twitter\": \"ClosetCooking\", \n \"site\": \"www.closetcooking.com\", \n \"num_recipes\": 1344, \n \"avatar\": \"http://a1.twimg.com/profile_images/743503137/Me_in_Sanotori_1.jpg\", \n \"avg_rating\": 38.38630101551397\n }, \n {\n \"name\": \"bell'alimento\", \n \"twitter\": \"bellalimento\", \n \"site\": \"www.bellalimento.com\", \n \"num_recipes\": 289, \n \"avatar\": \"http://si0.twimg.com/profile_images/315927819/Picture_278_reasonably_small.jpg\", \n \"avg_rating\": 38.33681128395489\n }, \n {\n \"name\": \"Kalyn's Kitchen\", \n \"twitter\": \"kalynskitchen\", \n \"site\": \"www.kalynskitchen.com\", \n \"num_recipes\": 724, \n \"avatar\": \"http://si0.twimg.com/profile_images/558949427/kalyn-300x300-kalynskitchen_reasonably_small.jpg\", \n \"avg_rating\": 38.06258266782799\n }, \n {\n \"name\": \"Gluten Free Girl\", \n \"twitter\": \"glutenfreegirl\", \n \"site\": \"glutenfreegirl.com\", \n \"num_recipes\": 265, \n \"avatar\": \"http://a1.twimg.com/profile_images/1627793930/shauna_s_new_headshot_reasonably_small.jpg\", \n \"avg_rating\": 37.881358045712446\n }, \n {\n \"name\": \"Doughmesstic\", \n \"twitter\": \"doughmesstic\", \n \"site\": \"doughmesstic.com\", \n \"num_recipes\": 118, \n \"avatar\": \"http://twimg0-a.akamaihd.net/profile_images/1272538021/sus6_reasonably_small.jpg\", \n \"avg_rating\": 37.66623386285117\n }, \n {\n \"name\": \"Indian Simmer\", \n \"twitter\": \"indiansimmer\", \n \"site\": \"www.indiansimmer.com\", \n \"num_recipes\": 49, \n \"avatar\": \"http://a1.twimg.com/profile_images/1091771046/IMG_0370_reasonably_small.jpg\", \n \"avg_rating\": 36.47687831270759\n }, \n {\n \"name\": \"Turntable Kitchen\", \n \"twitter\": \"TTableKitchen\", \n \"site\": \"www.turntablekitchen.com\", \n \"num_recipes\": 260, \n \"avatar\": \"http://a0.twimg.com/profile_images/1193847032/logo_100_reasonably_small.jpg\", \n \"avg_rating\": 36.163171110804655\n }, \n {\n \"name\": \"eCurry\", \n \"twitter\": \"Soma_R\", \n \"site\": \"www.ecurry.com\", \n \"num_recipes\": 249, \n \"avatar\": \"http://cdn.punchfork.net/eCurry-avatar.jpg\", \n \"avg_rating\": 35.2894115202827\n }, \n {\n \"name\": \"What's Gaby Cooking\", \n \"twitter\": \"whatsgabycookin\", \n \"site\": \"whatsgabycooking.com\", \n \"num_recipes\": 196, \n \"avatar\": \"http://si0.twimg.com/profile_images/1009160110/Gaby_Dalkin_Headshot-1_reasonably_small.jpg\", \n \"avg_rating\": 34.7884498491929\n }, \n {\n \"name\": \"Panini Happy\", \n \"twitter\": \"paninikathy\", \n \"site\": \"paninihappy.com\", \n \"num_recipes\": 144, \n \"avatar\": \"http://a3.twimg.com/profile_images/1109933739/KathyStrahs73.jpg\", \n \"avg_rating\": 33.98594541780987\n }, \n {\n \"name\": \"Poor Girl Eats Well\", \n \"twitter\": \"PoorGrlEatsWell\", \n \"site\": \"www.poorgirleatswell.com\", \n \"num_recipes\": 240, \n \"avatar\": \"http://twimg0-a.akamaihd.net/profile_images/1552738840/315694_10150386051835152_581175151_10147637_641440808_n_reasonably_small.jpg\", \n \"avg_rating\": 33.24171858885837\n }, \n {\n \"name\": \"Bunkycooks\", \n \"twitter\": \"bunkycooks\", \n \"site\": \"www.bunkycooks.com\", \n \"num_recipes\": 130, \n \"avatar\": \"http://a0.twimg.com/profile_images/1617781638/Bunky_reasonably_small.jpg\", \n \"avg_rating\": 33.13779078767211\n }, \n {\n \"name\": \"La Phemme Phoodie\", \n \"twitter\": \"LaPhemmePhoodie\", \n \"site\": \"laphemmephoodie.com\", \n \"num_recipes\": 58, \n \"avatar\": \"http://a1.twimg.com/profile_images/1471271732/twitter_pic_rev_reasonably_small.jpg\", \n \"avg_rating\": 32.67903629976177\n }, \n {\n \"name\": \"The Tomato Tart\", \n \"twitter\": \"thetomatotart\", \n \"site\": \"thetomatotart.com\", \n \"num_recipes\": 85, \n \"avatar\": \"http://a3.twimg.com/profile_images/1485075683/thetomatotart_square_reasonably_small.jpg\", \n \"avg_rating\": 32.50856128043382\n }, \n {\n \"name\": \"Eat the Love\", \n \"twitter\": \"eatthelove\", \n \"site\": \"www.eatthelove.com\", \n \"num_recipes\": 103, \n \"avatar\": \"http://si0.twimg.com/profile_images/1330001971/twitter_portrait190_reasonably_small.jpg\", \n \"avg_rating\": 32.48567029104143\n }, \n {\n \"name\": \"The Colors of Indian Cooking\", \n \"twitter\": \"kathygori\", \n \"site\": \"www.thecolorsofindiancooking.com\", \n \"num_recipes\": 38, \n \"avatar\": \"http://a2.twimg.com/profile_images/1728103968/image_reasonably_small.jpg\", \n \"avg_rating\": 32.480421732521194\n }, \n {\n \"name\": \"Allrecipes\", \n \"twitter\": \"Allrecipes\", \n \"site\": \"allrecipes.com\", \n \"num_recipes\": 9207, \n \"avatar\": \"http://si0.twimg.com/profile_images/1110173569/AR_Logo_Aug_2010_reasonably_small.png\", \n \"avg_rating\": 31.89960276553112\n }, \n {\n \"name\": \"Creative Culinary\", \n \"twitter\": \"creativculinary\", \n \"site\": \"www.creative-culinary.com\", \n \"num_recipes\": 218, \n \"avatar\": \"http://a1.twimg.com/profile_images/1355428207/twitter-cc_reasonably_small.jpg\", \n \"avg_rating\": 31.77910370253598\n }, \n {\n \"name\": \"Sassy Radish\", \n \"twitter\": \"sassyradish\", \n \"site\": \"www.sassyradish.com\", \n \"num_recipes\": 245, \n \"avatar\": \"http://a2.twimg.com/profile_images/1304767445/Twitter-Avatar---4-2011_reasonably_small.jpg\", \n \"avg_rating\": 31.72499638529717\n }, \n {\n \"name\": \"Weelicious\", \n \"twitter\": \"weelicious\", \n \"site\": \"weelicious.com\", \n \"num_recipes\": 713, \n \"avatar\": \"http://profile.ak.fbcdn.net/hprofile-ak-snc4/50315_248062301608_3990361_n.jpg\", \n \"avg_rating\": 31.46405199949303\n }, \n {\n \"name\": \"iVillage\", \n \"twitter\": \"iVillage\", \n \"site\": \"www.ivillage.com\", \n \"num_recipes\": 2055, \n \"avatar\": \"http://a0.twimg.com/profile_images/1796972040/twitterIvillageicon_reasonably_small.jpg\", \n \"avg_rating\": 31.369119707977177\n }, \n {\n \"name\": \"Brit\", \n \"twitter\": \"brit\", \n \"site\": \"www.hellobrit.com\", \n \"num_recipes\": 37, \n \"avatar\": \"http://a0.twimg.com/profile_images/1633256517/Twitter-Avatar_reasonably_small.jpg\", \n \"avg_rating\": 30.27330179127865\n }, \n {\n \"name\": \"Food Republic\", \n \"twitter\": \"foodrepublic\", \n \"site\": \"www.foodrepublic.com\", \n \"num_recipes\": 802, \n \"avatar\": \"http://twimg0-a.akamaihd.net/profile_images/1244378823/Food_Republic_Logo_reasonably_small.jpg\", \n \"avg_rating\": 30.07855908162928\n }, \n {\n \"name\": \"Chow\", \n \"twitter\": \"CHOW\", \n \"site\": \"www.chow.com\", \n \"num_recipes\": 1786, \n \"avatar\": \"http://si1.twimg.com/profile_images/1145414573/chow-icon_FB-TWITTER_reasonably_small.png\", \n \"avg_rating\": 29.82477860955752\n }, \n {\n \"name\": \"Nom Nom Paleo\", \n \"twitter\": \"nomnompaleo\", \n \"site\": \"nomnompaleo.com\", \n \"num_recipes\": 146, \n \"avatar\": \"http://media.tumblr.com/tumblr_lnbxpt9b3F1qdei8m.jpg\", \n \"avg_rating\": 29.411131520794964\n }, \n {\n \"name\": \"For the Love of Cooking\", \n \"twitter\": \"4loveofcooking\", \n \"site\": \"www.fortheloveofcooking.net\", \n \"num_recipes\": 575, \n \"avatar\": \"http://si0.twimg.com/profile_images/1308337127/IMG_5244.JPG\", \n \"avg_rating\": 29.32450442485162\n }, \n {\n \"name\": \"The Perfect Pantry\", \n \"twitter\": \"perfectpantry\", \n \"site\": \"www.theperfectpantry.com\", \n \"num_recipes\": 536, \n \"avatar\": \"http://media-cdn1.pinterest.com/avatars/perfectpantry-94_o.jpg\", \n \"avg_rating\": 28.760764000601654\n }, \n {\n \"name\": \"Tartelette\", \n \"twitter\": \"SweetTartelette\", \n \"site\": \"www.tarteletteblog.com\", \n \"num_recipes\": 486, \n \"avatar\": \"http://a2.twimg.com/profile_images/1444422622/Helene_1_Boost_reasonably_small.jpg\", \n \"avg_rating\": 28.391438232623738\n }, \n {\n \"name\": \"Bon Appetit\", \n \"twitter\": \"bonappetitmag\", \n \"site\": \"www.bonappetit.com\", \n \"num_recipes\": 3995, \n \"avatar\": \"http://a0.twimg.com/profile_images/1308597170/bon-appetit-twitter-icon.jpg\", \n \"avg_rating\": 28.376628516814648\n }, \n {\n \"name\": \"Chez Us\", \n \"twitter\": \"chezus\", \n \"site\": \"chezus.com\", \n \"num_recipes\": 114, \n \"avatar\": \"http://cdn.punchfork.net/chez-us-avatar.jpg\", \n \"avg_rating\": 28.318603796582845\n }, \n {\n \"name\": \"Cookin' Canuck\", \n \"twitter\": \"CookinCanuck\", \n \"site\": \"www.cookincanuck.com\", \n \"num_recipes\": 328, \n \"avatar\": \"http://twimg0-a.akamaihd.net/profile_images/1856990211/AvatarSmall2_reasonably_small.jpg\", \n \"avg_rating\": 27.71495126793146\n }, \n {\n \"name\": \"Naturally Ella\", \n \"twitter\": \"naturallyella\", \n \"site\": \"naturallyella.com\", \n \"num_recipes\": 252, \n \"avatar\": \"http://a1.twimg.com/profile_images/1318628127/20110402-IMG_2536-Edit_reasonably_small.jpg\", \n \"avg_rating\": 27.328279600721068\n }, \n {\n \"name\": \"Fine Cooking\", \n \"twitter\": \"finecooking\", \n \"site\": \"www.finecooking.com\", \n \"num_recipes\": 3151, \n \"avatar\": \"http://twimg0-a.akamaihd.net/profile_images/1616080348/mail-1_reasonably_small.jpeg\", \n \"avg_rating\": 27.230011633284068\n }, \n {\n \"name\": \"Framed Cooks\", \n \"twitter\": \"FramedCooks\", \n \"site\": \"www.framedcooks.com\", \n \"num_recipes\": 506, \n \"avatar\": \"http://twimg0-a.akamaihd.net/profile_images/1411474551/kmj_reasonably_small.jpg\", \n \"avg_rating\": 26.922601086834838\n }, \n {\n \"name\": \"Epicurious\", \n \"twitter\": \"epicurious\", \n \"site\": \"www.epicurious.com\", \n \"num_recipes\": 4395, \n \"avatar\": \"http://si3.twimg.com/profile_images/1015048338/epi-twitter-icon_reasonably_small.png\", \n \"avg_rating\": 26.44288364037819\n }, \n {\n \"name\": \"The Healthy Foodie\", \n \"twitter\": \"HealthyyyFoodie\", \n \"site\": \"thehealthyfoodie.com\", \n \"num_recipes\": 238, \n \"avatar\": \"http://si0.twimg.com/profile_images/2120232288/Healthy-Foodie-Badge_reasonably_small.jpg\", \n \"avg_rating\": 26.159284742496897\n }, \n {\n \"name\": \"Cinnamon Girl Recipes\", \n \"twitter\": \"Reeni_Spice\", \n \"site\": \"www.cinnamonspiceandeverythingnice.com\", \n \"num_recipes\": 463, \n \"avatar\": \"http://si0.twimg.com/profile_images/1491969445/camera-ME-_reasonably_small.jpg\", \n \"avg_rating\": 25.912724860581577\n }, \n {\n \"name\": \"Cookstr\", \n \"twitter\": \"cookstr\", \n \"site\": \"www.cookstr.com\", \n \"num_recipes\": 648, \n \"avatar\": \"http://si0.twimg.com/profile_images/178504614/Cookstr_Logo_Square_reasonably_small.jpg\", \n \"avg_rating\": 25.587983709544584\n }, \n {\n \"name\": \"My Cooking Diary\", \n \"twitter\": \"mycookingdiary\", \n \"site\": \"www.mycookingdiary.com\", \n \"num_recipes\": 41, \n \"avatar\": \"http://a1.twimg.com/profile_images/1382062243/Drawing_Sharon.jpg\", \n \"avg_rating\": 24.62576919678474\n }, \n {\n \"name\": \"No Recipes\", \n \"twitter\": \"norecipes\", \n \"site\": \"norecipes.com\", \n \"num_recipes\": 301, \n \"avatar\": \"http://a3.twimg.com/profile_images/1184044222/chef_marc_reasonably_small.jpg\", \n \"avg_rating\": 24.617378514513796\n }, \n {\n \"name\": \"RecipeRelay\", \n \"twitter\": \"RecipeRelay\", \n \"site\": \"reciperelay.com\", \n \"num_recipes\": 111, \n \"avatar\": \"http://a3.twimg.com/profile_images/1201892892/RR_logo_cropped_reasonably_small.jpg\", \n \"avg_rating\": 24.56166259157161\n }, \n {\n \"name\": \"Food52\", \n \"twitter\": \"food52\", \n \"site\": \"www.food52.com\", \n \"num_recipes\": 1278, \n \"avatar\": \"http://twimg0-a.akamaihd.net/profile_images/1586791455/52_reasonably_small.jpg\", \n \"avg_rating\": 24.52486709896959\n }, \n {\n \"name\": \"Big Girls Small Kitchen\", \n \"twitter\": \"BGSK\", \n \"site\": \"www.biggirlssmallkitchen.com\", \n \"num_recipes\": 531, \n \"avatar\": \"http://a0.twimg.com/profile_images/1180035103/71951_160917223932815_160917113932826_423317_3710062_n_reasonably_small.jpg\", \n \"avg_rating\": 22.73694749192208\n }, \n {\n \"name\": \"Sippity Sup\", \n \"twitter\": \"sippitysup\", \n \"site\": \"www.sippitysup.com\", \n \"num_recipes\": 301, \n \"avatar\": \"http://a2.twimg.com/profile_images/277087179/sipsupiconsquareblackSM_reasonably_small.jpg\", \n \"avg_rating\": 22.28291587232645\n }, \n {\n \"name\": \"Eclectic Recipes\", \n \"twitter\": \"EclecticRecipes\", \n \"site\": \"eclecticrecipes.com\", \n \"num_recipes\": 259, \n \"avatar\": \"http://a0.twimg.com/profile_images/1056949484/angeliamcgowan_reasonably_small.jpg\", \n \"avg_rating\": 20.126038298323554\n }, \n {\n \"name\": \"America's Test Kitchen\", \n \"twitter\": \"TestKitchen\", \n \"site\": \"www.americastestkitchenfeed.com\", \n \"num_recipes\": 212, \n \"avatar\": \"http://a1.twimg.com/profile_images/1152213541/Profile-pic_reasonably_small.jpg\", \n \"avg_rating\": 19.62921546331888\n }, \n {\n \"name\": \"Vintage Mixer\", \n \"twitter\": \"slcfoodie\", \n \"site\": \"thevintagemixer.com\", \n \"num_recipes\": 121, \n \"avatar\": \"http://twimg0-a.akamaihd.net/profile_images/1123886800/twitterphoto_fall_reasonably_small.jpg\", \n \"avg_rating\": 19.073919219488563\n }, \n {\n \"name\": \"Tablespoon\", \n \"twitter\": \"tablespoon\", \n \"site\": \"www.tablespoon.com\", \n \"num_recipes\": 995, \n \"avatar\": \"http://a3.twimg.com/profile_images/1168017671/twitter_profile_FINAL_bigger.jpg\", \n \"avg_rating\": 18.483839765080383\n }, \n {\n \"name\": \"Bob's Red Mill\", \n \"twitter\": \"Bobs_Red_Mill\", \n \"site\": \"www.bobsredmill.com\", \n \"num_recipes\": 144, \n \"avatar\": \"http://a0.twimg.com/profile_images/110975109/_MG_0115_reasonably_small.jpg\", \n \"avg_rating\": 18.009960821731465\n }, \n {\n \"name\": \"Global Table Adventure\", \n \"twitter\": \"globaltable\", \n \"site\": \"globaltableadventure.com\", \n \"num_recipes\": 389, \n \"avatar\": \"http://a0.twimg.com/profile_images/1217085269/logo.jpg\", \n \"avg_rating\": 17.49173968884991\n }, \n {\n \"name\": \"Lovefood\", \n \"twitter\": \"lovefood\", \n \"site\": \"www.lovefood.com\", \n \"num_recipes\": 266, \n \"avatar\": \"http://a3.twimg.com/profile_images/1230732797/twitterLOGO.jpg\", \n \"avg_rating\": 17.26326079471448\n }, \n {\n \"name\": \"Sarah's Cucina Bella\", \n \"twitter\": \"sarahwcaron\", \n \"site\": \"sarahscucinabella.com\", \n \"num_recipes\": 342, \n \"avatar\": \"http://a3.twimg.com/profile_images/1748083413/headshot2-closest_reasonably_small.jpg\", \n \"avg_rating\": 17.160523892716853\n }, \n {\n \"name\": \"Whole Living\", \n \"twitter\": \"wholeliving\", \n \"site\": \"www.wholeliving.com\", \n \"num_recipes\": 678, \n \"avatar\": \"http://twimg0-a.akamaihd.net/profile_images/1824876559/cover-wl-march-2012_vert__1__reasonably_small.jpg\", \n \"avg_rating\": 10.104279658125279\n }, \n {\n \"name\": \"Martha Stewart\", \n \"twitter\": \"MarthaStewart\", \n \"site\": \"www.marthastewart.com\", \n \"num_recipes\": 13131, \n \"avatar\": \"http://si2.twimg.com/profile_images/88784292/images_reasonably_small.jpeg\", \n \"avg_rating\": 9.51428181679453\n }\n ]\n}"},"http_version":"1.1"},"recorded_at":"Tue, 08 May 2012 00:58:07 GMT"}],"recorded_with":"VCR 2.1.1"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"http_interactions":[{"request":{"method":"get","uri":"https://api.punchfork.com/random_recipe?key=this-is-your-api-key","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["punchr gem version 1.0.0"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Tue, 08 May 2012 00:59:16 GMT"],"Server":["Apache/2.2.22 (Unix) DAV/2 mod_wsgi/3.3 Python/2.7 mod_ssl/2.2.22 OpenSSL/0.9.8k"],"Vary":["Accept-Encoding"],"Content-Encoding":["gzip"],"Content-Length":["335"],"Content-Type":["application/json"]},"body":{"encoding":"ASCII-8BIT","string":"{\n \"recipe\": {\n \"rating\": 3.7474, \n \"source_name\": \"Leite's Culinaria\", \n \"source_img\": \"http://leitesculinari.wpengine.netdna-cdn.com/wordpress/wp-content/uploads/delmonico_steak.jpg\", \n \"source_url\": \"http://leitesculinaria.com/5889/recipes-delmonico-steak.html\", \n \"fbc\": 0, \n \"twc\": 0, \n \"suc\": 0, \n \"thumb\": \"http://img.punchfork.net/edcbfaaaa56055d9843e1eb89a786a3d_250x250.jpg\", \n \"title\": \"Delmonico Steak\", \n \"pf_url\": \"http://punchfork.com/recipe/Delmonico-Steak-Leites-Culinaria\", \n \"published\": \"2008-05-05T23:01:28\", \n \"shortcode\": \"yFoHpt\"\n }\n}"},"http_version":"1.1"},"recorded_at":"Tue, 08 May 2012 00:59:16 GMT"}],"recorded_with":"VCR 2.1.1"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"http_interactions":[{"request":{"method":"get","uri":"https://api.punchfork.com/rate_limit_status?key=this-is-your-api-key","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["punchr gem version 1.0.0"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Tue, 08 May 2012 00:42:25 GMT"],"Server":["Apache/2.2.22 (Unix) DAV/2 mod_wsgi/3.3 Python/2.7 mod_ssl/2.2.22 OpenSSL/0.9.8k"],"Vary":["Accept-Encoding"],"Content-Encoding":["gzip"],"Content-Length":["50"],"Content-Type":["application/json"]},"body":{"encoding":"ASCII-8BIT","string":"{\n \"remaining_calls\": 250.0\n}"},"http_version":"1.1"},"recorded_at":"Tue, 08 May 2012 00:42:24 GMT"}],"recorded_with":"VCR 2.1.1"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"http_interactions":[{"request":{"method":"get","uri":"https://api.punchfork.com/recipes?key=this-is-your-api-key&q=meatballs","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["punchr gem version 1.0.0"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Tue, 08 May 2012 01:07:29 GMT"],"Server":["Apache/2.2.22 (Unix) DAV/2 mod_wsgi/3.3 Python/2.7 mod_ssl/2.2.22 OpenSSL/0.9.8k"],"Vary":["Accept-Encoding"],"Content-Encoding":["gzip"],"Content-Length":["1618"],"Content-Type":["application/json"]},"body":{"encoding":"ASCII-8BIT","string":"{\n \"count\": 10, \n \"recipes\": [\n {\n \"rating\": 96.1308, \n \"source_name\": \"Simply Recipes\", \n \"source_img\": \"http://simplyrecipes.com/photos/swedish-meatballs.jpg\", \n \"source_url\": \"http://simplyrecipes.com/recipes/swedish_meatballs/\", \n \"fbc\": 1362, \n \"twc\": 190, \n \"suc\": 945, \n \"thumb\": \"http://img.punchfork.net/4b80e38be22963f82a71a8e9c3ec2d06_250x250.jpg\", \n \"title\": \"Swedish Meatballs\", \n \"pf_url\": \"http://punchfork.com/recipe/Swedish-Meatballs-Simply-Recipes\", \n \"published\": \"2010-12-03T16:00:00\", \n \"shortcode\": \"irbF8a\"\n }, \n {\n \"rating\": 95.8584, \n \"source_name\": \"The Pioneer Woman\", \n \"source_img\": \"http://farm4.static.flickr.com/3452/3385764631_fbdb2a5722_o.jpg\", \n \"source_url\": \"http://thepioneerwoman.com/cooking/2009/03/bbq-meatballs-comfort-food-to-the-max/\", \n \"fbc\": 2386, \n \"twc\": 81, \n \"suc\": 3594, \n \"thumb\": \"http://img.punchfork.net/3c277ab152a28e4aad77df0b3053ed95_250x250.jpg\", \n \"title\": \"BBQ Meatballs\", \n \"pf_url\": \"http://punchfork.com/recipe/BBQ-Meatballs-The-Pioneer-Woman\", \n \"published\": \"2009-03-26T14:00:00\", \n \"shortcode\": \"zmeqSE\"\n }, \n {\n \"rating\": 95.2524, \n \"source_name\": \"Smitten Kitchen\", \n \"source_img\": \"http://farm6.static.flickr.com/5299/5414330325_356609617a.jpg\", \n \"source_url\": \"http://smittenkitchen.com/2011/02/meatball-sub-with-caramelized-onions/\", \n \"fbc\": 1176, \n \"twc\": 380, \n \"suc\": 531, \n \"thumb\": \"http://img.punchfork.net/a0d065fa1795104140268e95baed8007_250x250.jpg\", \n \"title\": \"Meatball Subs With Caramelized Onions\", \n \"pf_url\": \"http://punchfork.com/recipe/Meatball-Subs-With-Caramelized-Onions-Smitten-Kitchen\", \n \"published\": \"2011-02-04T13:00:00\", \n \"shortcode\": \"uUWu54\"\n }, \n {\n \"rating\": 93.6378, \n \"source_name\": \"The Pioneer Woman\", \n \"source_img\": \"http://farm5.static.flickr.com/4080/4791319511_1cd635bb9b_b.jpg\", \n \"source_url\": \"http://thepioneerwoman.com/cooking/2010/07/16-minute-meal-3-mini-meatball-sandwiches/\", \n \"fbc\": 1952, \n \"twc\": 57, \n \"suc\": 3545, \n \"thumb\": \"http://img.punchfork.net/15fde1a78fb0ae228639775e44296399_250x250.jpg\", \n \"title\": \"Mini Meatball Sandwiches\", \n \"pf_url\": \"http://punchfork.com/recipe/Mini-Meatball-Sandwiches-The-Pioneer-Woman\", \n \"published\": \"2010-07-17T14:00:00\", \n \"shortcode\": \"xSAd2h\"\n }, \n {\n \"rating\": 88.3052, \n \"source_name\": \"Simply Recipes\", \n \"source_img\": \"http://simplyrecipes.com/photos/italian-meatballs-d.jpg\", \n \"source_url\": \"http://simplyrecipes.com/recipes/italian_meatballs/\", \n \"fbc\": 523, \n \"twc\": 372, \n \"suc\": 43, \n \"thumb\": \"http://img.punchfork.net/bbc79757de3abc3b474969e2ab6bf643_250x250.jpg\", \n \"title\": \"Italian Meatballs\", \n \"pf_url\": \"http://punchfork.com/recipe/Italian-Meatballs-Simply-Recipes\", \n \"published\": \"2011-11-29T16:00:00\", \n \"shortcode\": \"rHiaMm\"\n }, \n {\n \"rating\": 84.9933, \n \"source_name\": \"Smitten Kitchen\", \n \"source_img\": \"http://farm8.staticflickr.com/7143/6602480103_b8a9781819.jpg\", \n \"source_url\": \"http://smittenkitchen.com/2011/12/scallion-meatballs-with-soy-ginger-glaze/\", \n \"fbc\": 369, \n \"twc\": 337, \n \"suc\": 10, \n \"thumb\": \"http://img.punchfork.net/d8816ef11c2b5e4b87a9a7438634da7f_250x250.jpg\", \n \"title\": \"Scallion Meatballs with Soy-Ginger Glaze\", \n \"pf_url\": \"http://punchfork.com/recipe/Scallion-Meatballs-with-Soy-Ginger-Glaze-Smitten-Kitchen\", \n \"published\": \"2011-12-31T02:45:13.025000\", \n \"shortcode\": \"nYJLyk\"\n }, \n {\n \"rating\": 84.7217, \n \"source_name\": \"Simply Recipes\", \n \"source_img\": \"http://simplyrecipes.com/photos/turkey-meatballs-tomato-basil-a.jpg\", \n \"source_url\": \"http://simplyrecipes.com/recipes/turkey_meatballs_with_tomatoes_and_basil/\", \n \"fbc\": 511, \n \"twc\": 118, \n \"suc\": 4, \n \"thumb\": \"http://img.punchfork.net/bb1f140253c93ecf2b51a9086429932a_250x250.jpg\", \n \"title\": \"Turkey Meatballs with Tomatoes and Basil\", \n \"pf_url\": \"http://punchfork.com/recipe/Turkey-Meatballs-with-Tomatoes-and-Basil-Simply-Recipes\", \n \"published\": \"2011-09-06T16:00:00\", \n \"shortcode\": \"jJh6v1\"\n }, \n {\n \"rating\": 83.5773, \n \"source_name\": \"Serious Eats\", \n \"source_img\": \"http://www.seriouseats.com/recipes/images/20110217-dt-meatballs-with-sriracha-marinara.jpg\", \n \"source_url\": \"http://www.seriouseats.com/recipes/2011/02/sriracha-marinara-with-meatballs-recipe.html\", \n \"fbc\": 204, \n \"twc\": 78, \n \"suc\": 2029, \n \"thumb\": \"http://img.punchfork.net/dc39bad79525604e7788d0512040af63_250x250.jpg\", \n \"title\": \"Sriracha Marinara with Meatballs\", \n \"pf_url\": \"http://punchfork.com/recipe/Sriracha-Marinara-with-Meatballs-Serious-Eats\", \n \"published\": \"2011-02-17T20:30:00\", \n \"shortcode\": \"igQCJ1\"\n }, \n {\n \"rating\": 83.5233, \n \"source_name\": \"The Pioneer Woman\", \n \"source_img\": \"http://static.thepioneerwoman.com/cooking/files/2010/12/5301946098_b8bf24c98e_o.jpg\", \n \"source_url\": \"http://thepioneerwoman.com/cooking/2010/12/meatballs-with-peppers-and-pineapple/\", \n \"fbc\": 921, \n \"twc\": 33, \n \"suc\": 1302, \n \"thumb\": \"http://img.punchfork.net/0ee712c0d9203dd8744d3673497524ca_250x250.jpg\", \n \"title\": \"Meatballs with Peppers and Pineapple\", \n \"pf_url\": \"http://punchfork.com/recipe/Meatballs-with-Peppers-and-Pineapple-The-Pioneer-Woman\", \n \"published\": \"2010-12-29T14:00:00\", \n \"shortcode\": \"uF5UNd\"\n }, \n {\n \"rating\": 83.5148, \n \"source_name\": \"Simply Recipes\", \n \"source_img\": \"http://simplyrecipes.com/photos/cranberry-glazed-turkey-meatballs-e.jpg\", \n \"source_url\": \"http://simplyrecipes.com/recipes/cranberry_glazed_turkey_meatballs/\", \n \"fbc\": 400, \n \"twc\": 141, \n \"suc\": 1, \n \"thumb\": \"http://img.punchfork.net/15b8f6ccba6d1bb633dcfc6a8ca97bf9_250x250.jpg\", \n \"title\": \"Cranberry Glazed Turkey Meatballs\", \n \"pf_url\": \"http://punchfork.com/recipe/Cranberry-Glazed-Turkey-Meatballs-Simply-Recipes\", \n \"published\": \"2011-12-14T03:35:07.272000\", \n \"shortcode\": \"ua3sR1\"\n }\n ], \n \"next_cursor\": \"83.51482591096793\"\n}"},"http_version":"1.1"},"recorded_at":"Tue, 08 May 2012 01:07:28 GMT"}],"recorded_with":"VCR 2.1.1"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"http_interactions":[{"request":{"method":"post","uri":"https://api.punchfork.com/search_index","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["punchr gem version 1.0.0"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Tue, 08 May 2012 01:10:27 GMT"],"Server":["Apache/2.2.22 (Unix) DAV/2 mod_wsgi/3.3 Python/2.7 mod_ssl/2.2.22 OpenSSL/0.9.8k"],"Vary":["Accept-Encoding"],"Content-Encoding":["gzip"],"Content-Length":["69"],"Content-Type":["application/json"]},"body":{"encoding":"ASCII-8BIT","string":"{\"terms\": [ \"bird\", \"bread crumb\", \"cheese\", \"chicken breast\", \"chicken\", \"condiment\", \"dairy\", \"egg\", \"meat\", \"mozzarella\", \"parmesan\", \"parmigiana\", \"poultry\", \"sauce\", \"spaghetti sauce\"]}"},"http_version":"1.1"},"recorded_at":"Tue, 08 May 2012 01:10:26 GMT"}],"recorded_with":"VCR 2.1.1"}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'punchr/client'
|
3
|
+
|
4
|
+
describe 'Punchr::Client' do
|
5
|
+
before(:each) do
|
6
|
+
Punchr.configure do |configuration|
|
7
|
+
configuration.api_key = 'this-is-your-api-key'
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
describe '#recipes' do
|
12
|
+
it 'should allow you to search for recipes' do
|
13
|
+
VCR.use_cassette('recipes', :record => :once) do
|
14
|
+
client = Punchr::Client.new
|
15
|
+
response = client.recipes(:q => 'meatballs')
|
16
|
+
response['count'].should == 10
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe '#random_recipe' do
|
22
|
+
it 'should allow you to retrieve a random recipe' do
|
23
|
+
VCR.use_cassette('random_recipe', :record => :once) do
|
24
|
+
client = Punchr::Client.new
|
25
|
+
response = client.random_recipe
|
26
|
+
response['recipe']['rating'].should == 3.7474
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe '#publishers' do
|
32
|
+
it 'should allow you to retrieve a list of publishers' do
|
33
|
+
VCR.use_cassette('publishers', :record => :once) do
|
34
|
+
client = Punchr::Client.new
|
35
|
+
response = client.publishers
|
36
|
+
response['publishers'].size.should == 85
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe '#diet_index' do
|
42
|
+
it 'should allow you to generate a list of diet terms describing which diets are safe for the input recipe ingredients' do
|
43
|
+
VCR.use_cassette('diet_index', :record => :once) do
|
44
|
+
client = Punchr::Client.new
|
45
|
+
response = client.diet_index('2 cups yellow cornmeal\n2 teaspoons baking powder\n3/4 to 1 teaspoon fine sea salt\n1 large egg, lightly beaten\n1 cup water, plus more if needed\n1/4 to 1/3 cup mild-flavored vegetable oil for frying')
|
46
|
+
response['diets'].size.should == 2
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe '#search_index' do
|
52
|
+
it 'should allow you to generate a list of search index terms for a recipe' do
|
53
|
+
VCR.use_cassette('search_index', :record => :once) do
|
54
|
+
client = Punchr::Client.new
|
55
|
+
response = client.search_index('Chicken Parmigiana', '1 egg, beaten\n2 ounces dry bread crumbs\n2 skinless, boneless chicken breast halves\n3/4 (16 ounce) jar spaghetti sauce\n2 ounces shredded mozzarella cheese\n1/4 cup grated Parmesan cheese')
|
56
|
+
response['terms'].size.should == 15
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe '#rate_limit_status' do
|
62
|
+
it 'should allow you to retrieve your rate limit status' do
|
63
|
+
VCR.use_cassette('rate_limit_status', :record => :once) do
|
64
|
+
client = Punchr::Client.new
|
65
|
+
response = client.rate_limit_status
|
66
|
+
response['remaining_calls'].should == 250
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Punchr::Configuration do
|
4
|
+
describe '#configure' do
|
5
|
+
it 'should allow you to configure punchr' do
|
6
|
+
Punchr.configure do |configuration|
|
7
|
+
configuration.api_key = 'punchr-api-key'
|
8
|
+
end
|
9
|
+
|
10
|
+
Punchr.api_key.should == 'punchr-api-key'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require 'punchr'
|
3
|
+
require 'vcr'
|
4
|
+
|
5
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
6
|
+
|
7
|
+
VCR.configure do |c|
|
8
|
+
c.cassette_library_dir = 'spec/cassettes'
|
9
|
+
c.hook_into :typhoeus
|
10
|
+
c.allow_http_connections_when_no_cassette = false
|
11
|
+
c.default_cassette_options = { :serialize_with => :json }
|
12
|
+
end
|
13
|
+
|
14
|
+
RSpec.configure do |config|
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,162 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: punchr
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- David Czarnecki
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-05-08 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: typhoeus
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: vcr
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: multi_json
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
description: Ruby gem for interacting with the Punchfork API
|
95
|
+
email:
|
96
|
+
- me@davidczarnecki.com
|
97
|
+
executables: []
|
98
|
+
extensions: []
|
99
|
+
extra_rdoc_files: []
|
100
|
+
files:
|
101
|
+
- .gitignore
|
102
|
+
- .rspec
|
103
|
+
- .rvmrc
|
104
|
+
- CHANGELOG.markdown
|
105
|
+
- Gemfile
|
106
|
+
- LICENSE.txt
|
107
|
+
- README.markdown
|
108
|
+
- Rakefile
|
109
|
+
- lib/punchr.rb
|
110
|
+
- lib/punchr/client.rb
|
111
|
+
- lib/punchr/configuration.rb
|
112
|
+
- lib/punchr/version.rb
|
113
|
+
- punchr.gemspec
|
114
|
+
- spec/cassettes/diet_index.json
|
115
|
+
- spec/cassettes/publishers.json
|
116
|
+
- spec/cassettes/random_recipe.json
|
117
|
+
- spec/cassettes/rate_limit_status.json
|
118
|
+
- spec/cassettes/recipes.json
|
119
|
+
- spec/cassettes/search_index.json
|
120
|
+
- spec/punchr/client_spec.rb
|
121
|
+
- spec/punchr/configuration_spec.rb
|
122
|
+
- spec/spec_helper.rb
|
123
|
+
homepage: https://github.com/punchfork/punchr
|
124
|
+
licenses: []
|
125
|
+
post_install_message:
|
126
|
+
rdoc_options: []
|
127
|
+
require_paths:
|
128
|
+
- lib
|
129
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
130
|
+
none: false
|
131
|
+
requirements:
|
132
|
+
- - ! '>='
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
segments:
|
136
|
+
- 0
|
137
|
+
hash: 4108682040540409481
|
138
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
140
|
+
requirements:
|
141
|
+
- - ! '>='
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0'
|
144
|
+
segments:
|
145
|
+
- 0
|
146
|
+
hash: 4108682040540409481
|
147
|
+
requirements: []
|
148
|
+
rubyforge_project: punchr
|
149
|
+
rubygems_version: 1.8.23
|
150
|
+
signing_key:
|
151
|
+
specification_version: 3
|
152
|
+
summary: Ruby gem for interacting with the Punchfork API
|
153
|
+
test_files:
|
154
|
+
- spec/cassettes/diet_index.json
|
155
|
+
- spec/cassettes/publishers.json
|
156
|
+
- spec/cassettes/random_recipe.json
|
157
|
+
- spec/cassettes/rate_limit_status.json
|
158
|
+
- spec/cassettes/recipes.json
|
159
|
+
- spec/cassettes/search_index.json
|
160
|
+
- spec/punchr/client_spec.rb
|
161
|
+
- spec/punchr/configuration_spec.rb
|
162
|
+
- spec/spec_helper.rb
|