ratr 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,36 @@
1
+ module Ratr
2
+ class OmdbHttpWrapper
3
+ INVALID_VALUES = ['N/A']
4
+
5
+ attr_reader :url
6
+ def initialize(options = {})
7
+ @url = options.fetch(:url, 'http://www.omdbapi.com')
8
+ end
9
+
10
+ def get(movie)
11
+ adapter.get do |request|
12
+ request.url '/'
13
+ request.params['t'] = movie.title
14
+ request.params['y'] = movie.year
15
+ end
16
+ end
17
+
18
+ def scrub(responses)
19
+ responses.reduce({}) do |memo, (index, response)|
20
+ rating = response.body['imdbRating']
21
+ memo[index] = []
22
+ memo[index].push(rating.to_f) if rating && !INVALID_VALUES.include?(rating)
23
+
24
+ memo
25
+ end
26
+ end
27
+
28
+ def adapter
29
+ @adapter ||= Faraday.new(url: url) do |faraday|
30
+ faraday.request :json
31
+ faraday.response :json
32
+ faraday.adapter :typhoeus
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,19 @@
1
+ module Ratr
2
+ class ParallelHttpProcessor
3
+ attr_reader :concurrency, :http_adapter
4
+ def initialize(options={})
5
+ @concurrency = options.fetch(:concurrency, 2)
6
+ @http_adapter = options[:http_adapter]
7
+ end
8
+
9
+ def process(&block)
10
+ http_adapter.in_parallel(parallel_manager) do
11
+ block.call
12
+ end
13
+ end
14
+
15
+ def parallel_manager
16
+ @parallel_manager ||= Typhoeus::Hydra.new(max_concurrency: concurrency)
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,22 @@
1
+ module Ratr
2
+ class PoolManager
3
+ attr_reader :sources, :results, :threads
4
+ def initialize(sources)
5
+ @sources, @results, @threads = sources, [], []
6
+ end
7
+
8
+ def process(movies)
9
+ sources.each do |source|
10
+ threads << Thread.new { results << source.fetch(movies) }
11
+ end
12
+ end
13
+
14
+ def merged_results
15
+ @merged_results ||= Ratr::ArrayOfHashes.merge(results)
16
+ end
17
+
18
+ def join
19
+ threads.each(&:join)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,72 @@
1
+ module Ratr
2
+ class RottenTomatoesHttpWrapper
3
+ INVALID_VALUES = [-1]
4
+ SCALAR = 10.0
5
+
6
+ attr_reader :url, :apikey
7
+ def initialize(options = {})
8
+ @apikey = options.fetch(:apikey, "ww8qgxbhjbqudvupbr8sqd7x")
9
+ @url = options.fetch(:url, 'http://api.rottentomatoes.com')
10
+ end
11
+
12
+ # RT is really the problem child when it comes to requesting
13
+ # multiple searches at once. It will return a 403 (forbidden)
14
+ # code on rate limit exceeded which is a pain in the bum.
15
+ #
16
+ # Faraday has ERR::Timeout retries built in, but this is
17
+ # unfortunatley not able to tap into it. The best I can do
18
+ # is to roll my own custom retry mechanism. The idea is
19
+ # to try and retry sooner than the 0.02 under most circumstances.
20
+ def get(movie)
21
+ retry_count = 3
22
+ begin
23
+ adapter.get do |request|
24
+ request.url '/api/public/v1.0/movies.json'
25
+ request.params['q'] = "#{movie.title} #{movie.year}"
26
+ request.params['apikey'] = apikey
27
+ request.params['page_limit'] = 1
28
+ end
29
+ rescue Faraday::Error::ClientError
30
+ case retry_count
31
+ when 3
32
+ sleep 0.05
33
+ when 2
34
+ sleep 0.1
35
+ when 1
36
+ sleep 0.2
37
+ end
38
+ retry_count -=1
39
+
40
+ retry if retry_count > 0
41
+ OpenStruct.new(body: {"movies" => []})
42
+ end
43
+ end
44
+
45
+ def scrub(responses)
46
+ responses.reduce({}) do |memo, (index, response)|
47
+ movie = response.body["movies"][0]
48
+ memo[index] = []
49
+
50
+ if movie
51
+ ratings = movie["ratings"]
52
+ critic = ratings["critics_score"]
53
+ audience = ratings["audience_score"]
54
+
55
+ memo[index].push(audience.to_f / SCALAR) if audience && !INVALID_VALUES.include?(audience)
56
+ memo[index].push(critic.to_f / SCALAR) if critic && !INVALID_VALUES.include?(critic)
57
+ end
58
+
59
+ memo
60
+ end
61
+ end
62
+
63
+ def adapter
64
+ @adapter ||= Faraday.new(url: url) do |faraday|
65
+ faraday.request :json
66
+ faraday.response :json
67
+ faraday.response :raise_error
68
+ faraday.adapter :typhoeus
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,10 @@
1
+ module Ratr
2
+ class SerialHttpProcessor
3
+ def initialize(options={})
4
+ end
5
+
6
+ def process(&block)
7
+ block.call
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,20 @@
1
+ module Ratr
2
+ class Source
3
+ attr_reader :processor, :wrapper
4
+ def initialize(processor, wrapper)
5
+ @wrapper = wrapper
6
+ @processor = processor.new(http_adapter: @wrapper.adapter)
7
+ end
8
+
9
+ def fetch(movies)
10
+ responses = {}
11
+
12
+ processor.process do
13
+ movies.each do |index, movie|
14
+ responses[index] = wrapper.get(movie)
15
+ end
16
+ end
17
+ wrapper.scrub(responses)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,9 @@
1
+ module Ratr
2
+ class ArrayOfHashes
3
+ def self.merge(array)
4
+ array.reduce({}) do |accumulator, hash|
5
+ accumulator.merge(hash) {|_, old_val, new_val| old_val + new_val}
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ module Ratr
2
+ class AverageCalculator
3
+ NO_SCORE = "N/A"
4
+
5
+ def self.call(scores)
6
+ average = NO_SCORE
7
+ average = (scores.reduce(&:+) / scores.size).round(1) if scores.size > 0
8
+
9
+ MetaRating.new(average, NO_SCORE)
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module Ratr
2
- VERSION = '0.2.0'
2
+ VERSION = '1.0.0'
3
3
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |gem|
9
9
  gem.homepage = "https://github.com/patricksrobertson/ratr"
10
10
  gem.license = "MIT"
11
11
 
12
- gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
+ gem.executables = ["ratr"]
13
13
  gem.files = `git ls-files`.split("\n")
14
14
  gem.name = "ratr"
15
15
  gem.require_paths = ["lib"]
@@ -18,4 +18,8 @@ Gem::Specification.new do |gem|
18
18
  gem.add_dependency 'faraday', '~> 0.9'
19
19
  gem.add_dependency 'faraday_middleware', '~> 0.9'
20
20
  gem.add_dependency 'typhoeus', '~> 0.7'
21
+
22
+ gem.add_development_dependency 'rspec', '~> 3.1'
23
+ gem.add_development_dependency 'vcr', '~> 2.9'
24
+ gem.add_development_dependency 'webmock', '~> 1.11'
21
25
  end
@@ -0,0 +1,18 @@
1
+ require 'ratr'
2
+
3
+ describe Ratr::Application do
4
+ let(:application) { Ratr::Application.new }
5
+ let(:expected_result) do
6
+ ["20 Feet from Stardom (2013): 9.1",
7
+ "7th Heaven (1927): 8.9",
8
+ "12 Years a Slave (2013): 8.9",
9
+ "7 Faces of Dr. Lao (1964): 8.4",
10
+ "8 Mile (2002): 6.6"]
11
+ end
12
+
13
+ describe '#call', :vcr do
14
+ it 'returns an array of movies scored high to low from the provided CSV' do
15
+ expect(application.call).to eq(expected_result)
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,34 @@
1
+ require 'ratr'
2
+
3
+ describe Ratr::ArrayOfHashes do
4
+ describe '.merge' do
5
+ let(:merge) { Ratr::ArrayOfHashes.merge(array) }
6
+
7
+ context 'singular hash' do
8
+ let(:array) { [{"a" => [1], "b" => [2]}] }
9
+
10
+ it 'returns the hash' do
11
+ expect(merge).to eq array[0]
12
+ end
13
+ end
14
+
15
+ context 'two hashes' do
16
+ let(:array) {[{"a" => [1], "b" => [2]}, {"a" => [2], "b" => [1]}] }
17
+
18
+ it 'merges them like a normal merge' do
19
+ expected_result = {"a" => [1,2], "b" => [2,1]}
20
+
21
+ expect(merge).to eq expected_result
22
+ end
23
+ end
24
+
25
+ context 'three hashes (n hashes really)' do
26
+ let(:array) {[{"a" => [1], "b" =>[3]}, {"a" => [2], "b" =>[2]}, {"a" =>[3], "b"=>[1]}] }
27
+ it 'merges them just like two hashes, but with #reduce' do
28
+ expected_result = {"a" => [1,2,3], "b" => [3,2,1]}
29
+
30
+ expect(merge).to eq expected_result
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,22 @@
1
+ require 'ratr'
2
+
3
+ describe Ratr::AverageCalculator do
4
+ describe '.call' do
5
+ let(:calculator) { Ratr::AverageCalculator.call(scores) }
6
+
7
+ context 'empty scores array passed in' do
8
+ let(:scores) { [] }
9
+
10
+ it 'returns N/A' do
11
+ expect(calculator.to_s).to eq 'N/A'
12
+ end
13
+ end
14
+
15
+ context 'scores passed in' do
16
+ let(:scores) { [6.2, 5.3, 9.4] }
17
+ it 'returns an average rounded to 1 decimal point' do
18
+ expect(calculator.to_s).to eq '7.0'
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,26 @@
1
+ require 'ratr'
2
+
3
+ describe Ratr::MetaRating do
4
+ let(:na) { "N/A" }
5
+ describe 'comparison' do
6
+ let(:no_score) { Ratr::MetaRating.new(na, na) }
7
+ let(:high_score) { Ratr::MetaRating.new(8.4) }
8
+ let(:low_score) { Ratr::MetaRating.new(8.3) }
9
+
10
+ context 'comparison of no score with anything should be less than' do
11
+ it { expect(no_score < no_score).to be true }
12
+ it { expect(no_score < low_score).to be true }
13
+ it { expect(no_score < high_score).to be true }
14
+ end
15
+
16
+ context 'comparison of actual score with no score should be greater than' do
17
+ it { expect(high_score > no_score).to be true }
18
+ it { expect(low_score > no_score).to be true }
19
+ end
20
+
21
+ context 'comparison of actual numbers should follow reason' do
22
+ it { expect(high_score > low_score).to be true }
23
+ it { expect(low_score == low_score).to be true }
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,35 @@
1
+ require 'ratr'
2
+ require 'ostruct'
3
+
4
+ describe Ratr::Source do
5
+ let(:movies) { {
6
+ first: OpenStruct.new(title: "8 Mile", year: "2002"),
7
+ second: OpenStruct.new(title: "The Abyss", year: "1989") }
8
+ }
9
+
10
+ describe 'rotten tomatoes source' do
11
+ let(:source) { Ratr::Source.new(Ratr::SerialHttpProcessor, Ratr::RottenTomatoesHttpWrapper.new) }
12
+
13
+ describe '#fetch', :vcr do
14
+ it "returns scores for each movie provided" do
15
+ fetched_scores = source.fetch(movies)
16
+
17
+ expect(fetched_scores[:first]).to eq([5.4, 7.6])
18
+ expect(fetched_scores[:second]).to eq([8.3, 8.9])
19
+ end
20
+ end
21
+ end
22
+
23
+ describe 'omdb source' do
24
+ let(:source) { Ratr::Source.new(Ratr::ParallelHttpProcessor, Ratr::OmdbHttpWrapper.new) }
25
+
26
+ describe '#fetch', :vcr do
27
+ it "returns scores for each movie provided" do
28
+ fetched_scores = source.fetch(movies)
29
+
30
+ expect(fetched_scores[:first]).to eq [6.9]
31
+ expect(fetched_scores[:second]).to eq [7.6]
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,25 @@
1
+ require 'vcr'
2
+ require 'bundler/setup'
3
+ Bundler.setup
4
+
5
+ RSpec.configure do |config|
6
+ config.expect_with :rspec do |expectations|
7
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
8
+ end
9
+
10
+ config.mock_with :rspec do |mocks|
11
+ mocks.verify_partial_doubles = true
12
+ end
13
+
14
+ if config.files_to_run.one?
15
+ config.default_formatter = 'doc'
16
+ end
17
+
18
+ config.order = :random
19
+ end
20
+
21
+ VCR.configure do |c|
22
+ c.cassette_library_dir = 'spec/vcr'
23
+ c.hook_into :webmock
24
+ c.configure_rspec_metadata!
25
+ end
@@ -0,0 +1,671 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://www.omdbapi.com/?t=7%20Faces%20of%20Dr.%20Lao&y=1964
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ response:
13
+ status:
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ Cache-Control:
18
+ - public, max-age=3083
19
+ Content-Type:
20
+ - application/json; charset=utf-8
21
+ Expires:
22
+ - Fri, 08 May 2015 13:05:58 GMT
23
+ Last-Modified:
24
+ - Fri, 08 May 2015 12:05:58 GMT
25
+ Vary:
26
+ - ! '*'
27
+ Server:
28
+ - Microsoft-IIS/7.5
29
+ X-Aspnet-Version:
30
+ - 4.0.30319
31
+ X-Powered-By:
32
+ - ASP.NET
33
+ Access-Control-Allow-Origin:
34
+ - ! '*'
35
+ Date:
36
+ - Fri, 08 May 2015 12:14:34 GMT
37
+ Content-Length:
38
+ - '807'
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ! '{"Title":"7 Faces of Dr. Lao","Year":"1964","Rated":"N/A","Released":"13
42
+ Aug 1964","Runtime":"100 min","Genre":"Fantasy, Mystery, Western","Director":"George
43
+ Pal","Writer":"Charles Beaumont (screen play), Charles G. Finney (based on
44
+ the novel \"The Circus of Dr. Lao\" by)","Actors":"Tony Randall, Barbara Eden,
45
+ Arthur O''Connell, John Ericson","Plot":"A mysterious circus comes to a western
46
+ town bearing wonders and characters that entertain the inhabitants and teach
47
+ valuable lessons.","Language":"English","Country":"USA","Awards":"Nominated
48
+ for 1 Oscar. Another 1 win & 1 nomination.","Poster":"http://ia.media-imdb.com/images/M/MV5BMTMyNTgyMTAxMV5BMl5BanBnXkFtZTcwMDM2NDAyMQ@@._V1_SX300.jpg","Metascore":"N/A","imdbRating":"7.3","imdbVotes":"3,192","imdbID":"tt0057812","Type":"movie","Response":"True"}'
49
+ http_version:
50
+ recorded_at: Fri, 08 May 2015 12:14:36 GMT
51
+ - request:
52
+ method: get
53
+ uri: http://www.omdbapi.com/?t=7th%20Heaven&y=1927
54
+ body:
55
+ encoding: US-ASCII
56
+ string: ''
57
+ headers:
58
+ User-Agent:
59
+ - Faraday v0.9.1
60
+ response:
61
+ status:
62
+ code: 200
63
+ message: OK
64
+ headers:
65
+ Cache-Control:
66
+ - public, max-age=3083
67
+ Content-Type:
68
+ - application/json; charset=utf-8
69
+ Expires:
70
+ - Fri, 08 May 2015 13:05:58 GMT
71
+ Last-Modified:
72
+ - Fri, 08 May 2015 12:05:58 GMT
73
+ Vary:
74
+ - ! '*'
75
+ Server:
76
+ - Microsoft-IIS/7.5
77
+ X-Aspnet-Version:
78
+ - 4.0.30319
79
+ X-Powered-By:
80
+ - ASP.NET
81
+ Access-Control-Allow-Origin:
82
+ - ! '*'
83
+ Date:
84
+ - Fri, 08 May 2015 12:14:34 GMT
85
+ Content-Length:
86
+ - '746'
87
+ body:
88
+ encoding: US-ASCII
89
+ string: ! '{"Title":"7th Heaven","Year":"1927","Rated":"NOT RATED","Released":"N/A","Runtime":"110
90
+ min","Genre":"Drama, Romance","Director":"Frank Borzage","Writer":"Austin
91
+ Strong (play), Benjamin Glazer (screenplay), H.H. Caldwell (titles), Katherine
92
+ Hilliker (titles)","Actors":"Janet Gaynor, Charles Farrell, Ben Bard, Albert
93
+ Gran","Plot":"A street cleaner saves a young woman''s life, and the pair slowly
94
+ fall in love until war intervenes.","Language":"English","Country":"USA","Awards":"Won
95
+ 3 Oscars. Another 3 wins & 2 nominations.","Poster":"http://ia.media-imdb.com/images/M/MV5BMTk2MjUzMzk3OV5BMl5BanBnXkFtZTcwOTk1MjQxMw@@._V1_SX300.jpg","Metascore":"N/A","imdbRating":"7.9","imdbVotes":"1,790","imdbID":"tt0018379","Type":"movie","Response":"True"}'
96
+ http_version:
97
+ recorded_at: Fri, 08 May 2015 12:14:36 GMT
98
+ - request:
99
+ method: get
100
+ uri: http://www.omdbapi.com/?t=8%20Mile&y=2002
101
+ body:
102
+ encoding: US-ASCII
103
+ string: ''
104
+ headers:
105
+ User-Agent:
106
+ - Faraday v0.9.1
107
+ response:
108
+ status:
109
+ code: 200
110
+ message: OK
111
+ headers:
112
+ Cache-Control:
113
+ - public, max-age=3083
114
+ Content-Type:
115
+ - application/json; charset=utf-8
116
+ Expires:
117
+ - Fri, 08 May 2015 13:05:58 GMT
118
+ Last-Modified:
119
+ - Fri, 08 May 2015 12:05:58 GMT
120
+ Vary:
121
+ - ! '*'
122
+ Server:
123
+ - Microsoft-IIS/7.5
124
+ X-Aspnet-Version:
125
+ - 4.0.30319
126
+ X-Powered-By:
127
+ - ASP.NET
128
+ Access-Control-Allow-Origin:
129
+ - ! '*'
130
+ Date:
131
+ - Fri, 08 May 2015 12:14:35 GMT
132
+ Content-Length:
133
+ - '716'
134
+ body:
135
+ encoding: US-ASCII
136
+ string: ! '{"Title":"8 Mile","Year":"2002","Rated":"R","Released":"8 Nov 2002","Runtime":"110
137
+ min","Genre":"Drama, Music","Director":"Curtis Hanson","Writer":"Scott Silver","Actors":"Eminem,
138
+ Kim Basinger, Mekhi Phifer, Brittany Murphy","Plot":"A young rapper, struggling
139
+ with every aspect of his life, wants to make the most of what could be his
140
+ final opportunity but his problems around gives him doubts.","Language":"English","Country":"USA,
141
+ Germany","Awards":"Won 1 Oscar. Another 10 wins & 19 nominations.","Poster":"http://ia.media-imdb.com/images/M/MV5BMTU2MTgyOTk3MF5BMl5BanBnXkFtZTYwOTg2NTI5._V1_SX300.jpg","Metascore":"77","imdbRating":"6.9","imdbVotes":"156,790","imdbID":"tt0298203","Type":"movie","Response":"True"}'
142
+ http_version:
143
+ recorded_at: Fri, 08 May 2015 12:14:36 GMT
144
+ - request:
145
+ method: get
146
+ uri: http://www.omdbapi.com/?t=12%20Years%20a%20Slave&y=2013
147
+ body:
148
+ encoding: US-ASCII
149
+ string: ''
150
+ headers:
151
+ User-Agent:
152
+ - Faraday v0.9.1
153
+ response:
154
+ status:
155
+ code: 200
156
+ message: OK
157
+ headers:
158
+ Cache-Control:
159
+ - public, max-age=3082
160
+ Content-Type:
161
+ - application/json; charset=utf-8
162
+ Expires:
163
+ - Fri, 08 May 2015 13:05:58 GMT
164
+ Last-Modified:
165
+ - Fri, 08 May 2015 12:05:58 GMT
166
+ Vary:
167
+ - ! '*'
168
+ Server:
169
+ - Microsoft-IIS/7.5
170
+ X-Aspnet-Version:
171
+ - 4.0.30319
172
+ X-Powered-By:
173
+ - ASP.NET
174
+ Access-Control-Allow-Origin:
175
+ - ! '*'
176
+ Date:
177
+ - Fri, 08 May 2015 12:14:35 GMT
178
+ Content-Length:
179
+ - '779'
180
+ body:
181
+ encoding: US-ASCII
182
+ string: ! '{"Title":"12 Years a Slave","Year":"2013","Rated":"R","Released":"8
183
+ Nov 2013","Runtime":"134 min","Genre":"Biography, Drama, History","Director":"Steve
184
+ McQueen","Writer":"John Ridley (screenplay), Solomon Northup (based on \"Twelve
185
+ Years a Slave\" by)","Actors":"Chiwetel Ejiofor, Dwight Henry, Dickie Gravois,
186
+ Bryan Batt","Plot":"In the antebellum United States, Solomon Northup, a free
187
+ black man from upstate New York, is abducted and sold into slavery.","Language":"English","Country":"USA,
188
+ UK","Awards":"Won 3 Oscars. Another 240 wins & 224 nominations.","Poster":"http://ia.media-imdb.com/images/M/MV5BMjExMTEzODkyN15BMl5BanBnXkFtZTcwNTU4NTc4OQ@@._V1_SX300.jpg","Metascore":"97","imdbRating":"8.1","imdbVotes":"322,173","imdbID":"tt2024544","Type":"movie","Response":"True"}'
189
+ http_version:
190
+ recorded_at: Fri, 08 May 2015 12:14:36 GMT
191
+ - request:
192
+ method: get
193
+ uri: http://api.rottentomatoes.com/api/public/v1.0/movies.json?apikey=ww8qgxbhjbqudvupbr8sqd7x&page_limit=1&q=7%20Faces%20of%20Dr.%20Lao%201964
194
+ body:
195
+ encoding: US-ASCII
196
+ string: ''
197
+ headers:
198
+ User-Agent:
199
+ - Faraday v0.9.1
200
+ response:
201
+ status:
202
+ code: 200
203
+ message: OK
204
+ headers:
205
+ Content-Language:
206
+ - en-US
207
+ Content-Type:
208
+ - text/javascript;charset=ISO-8859-1
209
+ Date:
210
+ - Fri, 08 May 2015 12:06:04 GMT
211
+ Flx-Build-Date:
212
+ - '2015-05-07 12:53:20'
213
+ Flx-Commit:
214
+ - JOBRELEASE.2015-05-07.12-25-31 3a929c5
215
+ Flx-Server:
216
+ - web235.flixster.com
217
+ Rt-Commit:
218
+ - 2001eec
219
+ Server:
220
+ - Mashery Proxy
221
+ Set-Cookie:
222
+ - JSESSIONID=7C30C4227E56EE8E326FFFF83DD40C9F; Path=/; HttpOnly
223
+ Vary:
224
+ - User-Agent,Accept-Encoding
225
+ X-Mashery-Responder:
226
+ - prod-j-worker-us-east-1d-70.mashery.com
227
+ Content-Length:
228
+ - '2013'
229
+ Connection:
230
+ - keep-alive
231
+ body:
232
+ encoding: US-ASCII
233
+ string: ! '
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+ {"total":1,"movies":[{"id":"17124","title":"Seven Faces of Dr. Lao","year":1964,"mpaa_rating":"Unrated","runtime":100,"release_dates":{"theater":"1964-03-18","dvd":"2000-10-03"},"ratings":{"critics_rating":"Fresh","critics_score":100,"audience_rating":"Upright","audience_score":78},"synopsis":"","posters":{"thumbnail":"http://resizing.flixster.com/o_MXZ-V2u1UL6rckvHZCtYluNxk=/53x81/dkpu1ddg7pbsk.cloudfront.net/movie/11/15/34/11153473_ori.jpg","profile":"http://resizing.flixster.com/o_MXZ-V2u1UL6rckvHZCtYluNxk=/53x81/dkpu1ddg7pbsk.cloudfront.net/movie/11/15/34/11153473_ori.jpg","detailed":"http://resizing.flixster.com/o_MXZ-V2u1UL6rckvHZCtYluNxk=/53x81/dkpu1ddg7pbsk.cloudfront.net/movie/11/15/34/11153473_ori.jpg","original":"http://resizing.flixster.com/o_MXZ-V2u1UL6rckvHZCtYluNxk=/53x81/dkpu1ddg7pbsk.cloudfront.net/movie/11/15/34/11153473_ori.jpg"},"abridged_cast":[{"name":"Tony
267
+ Randall","id":"162657394","characters":["Dr. Lao/Merlin/Pan/Abominable Snowman/Medusa"]},{"name":"Barbara
268
+ Eden","id":"364604435","characters":["Angela Benedict"]},{"name":"Arthur O''Connell","id":"353658591","characters":["Clint
269
+ Stark"]},{"name":"John Ericson","id":"405589649","characters":["Ed Cunningham"]},{"name":"Lee
270
+ Patrick","id":"770710631","characters":["Mrs. Howard T. Cassan"]}],"alternate_ids":{"imdb":"0057812"},"links":{"self":"http://api.rottentomatoes.com/api/public/v1.0/movies/17124.json","alternate":"http://www.rottentomatoes.com/m/seven_faces_of_dr_lao/","cast":"http://api.rottentomatoes.com/api/public/v1.0/movies/17124/cast.json","reviews":"http://api.rottentomatoes.com/api/public/v1.0/movies/17124/reviews.json","similar":"http://api.rottentomatoes.com/api/public/v1.0/movies/17124/similar.json"}}],"links":{"self":"http://api.rottentomatoes.com/api/public/v1.0/movies.json?q=7+Faces+of+Dr.+Lao+1964&page_limit=1&page=1"},"link_template":"http://api.rottentomatoes.com/api/public/v1.0/movies.json?q={search-term}&page_limit={results-per-page}&page={page-number}"}
271
+
272
+ '
273
+ http_version:
274
+ recorded_at: Fri, 08 May 2015 12:14:36 GMT
275
+ - request:
276
+ method: get
277
+ uri: http://api.rottentomatoes.com/api/public/v1.0/movies.json?apikey=ww8qgxbhjbqudvupbr8sqd7x&page_limit=1&q=7th%20Heaven%201927
278
+ body:
279
+ encoding: US-ASCII
280
+ string: ''
281
+ headers:
282
+ User-Agent:
283
+ - Faraday v0.9.1
284
+ response:
285
+ status:
286
+ code: 200
287
+ message: OK
288
+ headers:
289
+ Content-Language:
290
+ - en-US
291
+ Content-Type:
292
+ - text/javascript;charset=ISO-8859-1
293
+ Date:
294
+ - Fri, 08 May 2015 12:06:04 GMT
295
+ Flx-Build-Date:
296
+ - '2015-05-07 12:53:20'
297
+ Flx-Commit:
298
+ - JOBRELEASE.2015-05-07.12-25-31 3a929c5
299
+ Flx-Server:
300
+ - web236.flixster.com
301
+ Rt-Commit:
302
+ - 2001eec
303
+ Server:
304
+ - Mashery Proxy
305
+ Set-Cookie:
306
+ - JSESSIONID=68309AC19807C632740ECD2DDF07B218; Path=/; HttpOnly
307
+ Vary:
308
+ - User-Agent,Accept-Encoding
309
+ X-Mashery-Responder:
310
+ - prod-j-worker-us-east-1b-52.mashery.com
311
+ Content-Length:
312
+ - '2049'
313
+ Connection:
314
+ - keep-alive
315
+ body:
316
+ encoding: US-ASCII
317
+ string: ! '
318
+
319
+
320
+
321
+
322
+
323
+
324
+
325
+
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+
348
+
349
+
350
+ {"total":8,"movies":[{"id":"335719007","title":"Seventh Heaven (1927)","year":1927,"mpaa_rating":"Unrated","runtime":119,"release_dates":{"theater":"1927-05-25","dvd":"2008-12-09"},"ratings":{"critics_rating":"Fresh","critics_score":100,"audience_rating":"Upright","audience_score":87},"synopsis":"","posters":{"thumbnail":"http://resizing.flixster.com/LG34FNJCVJbLK44bRD-0LvfwvZ8=/54x79/dkpu1ddg7pbsk.cloudfront.net/movie/10/90/29/10902929_ori.jpg","profile":"http://resizing.flixster.com/LG34FNJCVJbLK44bRD-0LvfwvZ8=/54x79/dkpu1ddg7pbsk.cloudfront.net/movie/10/90/29/10902929_ori.jpg","detailed":"http://resizing.flixster.com/LG34FNJCVJbLK44bRD-0LvfwvZ8=/54x79/dkpu1ddg7pbsk.cloudfront.net/movie/10/90/29/10902929_ori.jpg","original":"http://resizing.flixster.com/LG34FNJCVJbLK44bRD-0LvfwvZ8=/54x79/dkpu1ddg7pbsk.cloudfront.net/movie/10/90/29/10902929_ori.jpg"},"abridged_cast":[{"name":"Janet
351
+ Gaynor","id":"326397126","characters":["Diane"]},{"name":"Charles Farrell","id":"335719008","characters":["Chico"]},{"name":"Gladys
352
+ Brockwell","id":"770787029","characters":["Nana"]},{"name":"Ben Bard","id":"186045344","characters":["Col.
353
+ Brissac"]},{"name":"David Butler (I)","id":"335719010","characters":["Gobin"]}],"alternate_ids":{"imdb":"0018379"},"links":{"self":"http://api.rottentomatoes.com/api/public/v1.0/movies/335719007.json","alternate":"http://www.rottentomatoes.com/m/7th_heaven/","cast":"http://api.rottentomatoes.com/api/public/v1.0/movies/335719007/cast.json","reviews":"http://api.rottentomatoes.com/api/public/v1.0/movies/335719007/reviews.json","similar":"http://api.rottentomatoes.com/api/public/v1.0/movies/335719007/similar.json"}}],"links":{"self":"http://api.rottentomatoes.com/api/public/v1.0/movies.json?q=7th+Heaven+1927&page_limit=1&page=1","next":"http://api.rottentomatoes.com/api/public/v1.0/movies.json?q=7th+Heaven+1927&page_limit=1&page=2"},"link_template":"http://api.rottentomatoes.com/api/public/v1.0/movies.json?q={search-term}&page_limit={results-per-page}&page={page-number}"}
354
+
355
+ '
356
+ http_version:
357
+ recorded_at: Fri, 08 May 2015 12:14:36 GMT
358
+ - request:
359
+ method: get
360
+ uri: http://www.omdbapi.com/?t=20%20Feet%20from%20Stardom&y=2013
361
+ body:
362
+ encoding: US-ASCII
363
+ string: ''
364
+ headers:
365
+ User-Agent:
366
+ - Faraday v0.9.1
367
+ response:
368
+ status:
369
+ code: 200
370
+ message: OK
371
+ headers:
372
+ Cache-Control:
373
+ - public, max-age=3083
374
+ Content-Type:
375
+ - application/json; charset=utf-8
376
+ Expires:
377
+ - Fri, 08 May 2015 13:05:59 GMT
378
+ Last-Modified:
379
+ - Fri, 08 May 2015 12:05:59 GMT
380
+ Vary:
381
+ - ! '*'
382
+ Server:
383
+ - Microsoft-IIS/7.5
384
+ X-Aspnet-Version:
385
+ - 4.0.30319
386
+ X-Powered-By:
387
+ - ASP.NET
388
+ Access-Control-Allow-Origin:
389
+ - ! '*'
390
+ Date:
391
+ - Fri, 08 May 2015 12:14:35 GMT
392
+ Content-Length:
393
+ - '47'
394
+ body:
395
+ encoding: US-ASCII
396
+ string: ! '{"Response":"False","Error":"Movie not found!"}'
397
+ http_version:
398
+ recorded_at: Fri, 08 May 2015 12:14:36 GMT
399
+ - request:
400
+ method: get
401
+ uri: http://api.rottentomatoes.com/api/public/v1.0/movies.json?apikey=ww8qgxbhjbqudvupbr8sqd7x&page_limit=1&q=8%20Mile%202002
402
+ body:
403
+ encoding: US-ASCII
404
+ string: ''
405
+ headers:
406
+ User-Agent:
407
+ - Faraday v0.9.1
408
+ response:
409
+ status:
410
+ code: 200
411
+ message: OK
412
+ headers:
413
+ Content-Language:
414
+ - en-US
415
+ Content-Type:
416
+ - text/javascript;charset=ISO-8859-1
417
+ Date:
418
+ - Fri, 08 May 2015 12:06:04 GMT
419
+ Flx-Build-Date:
420
+ - '2015-05-07 12:53:20'
421
+ Flx-Commit:
422
+ - JOBRELEASE.2015-05-07.12-25-31 3a929c5
423
+ Flx-Server:
424
+ - web235.flixster.com
425
+ Rt-Commit:
426
+ - 2001eec
427
+ Server:
428
+ - Mashery Proxy
429
+ Set-Cookie:
430
+ - JSESSIONID=31FA3879BB96A73E02A2862FBF104585; Path=/; HttpOnly
431
+ Vary:
432
+ - User-Agent,Accept-Encoding
433
+ X-Mashery-Responder:
434
+ - prod-j-worker-us-east-1b-59.mashery.com
435
+ Content-Length:
436
+ - '2035'
437
+ Connection:
438
+ - keep-alive
439
+ body:
440
+ encoding: US-ASCII
441
+ string: ! '
442
+
443
+
444
+
445
+
446
+
447
+
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+
456
+
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+
465
+
466
+
467
+
468
+
469
+
470
+
471
+
472
+
473
+
474
+ {"total":6,"movies":[{"id":"13198","title":"8 Mile","year":2002,"mpaa_rating":"R","runtime":111,"critics_consensus":"","release_dates":{"theater":"2002-11-08","dvd":"2003-03-18"},"ratings":{"critics_rating":"Certified
475
+ Fresh","critics_score":76,"audience_rating":"Spilled","audience_score":54},"synopsis":"","posters":{"thumbnail":"http://resizing.flixster.com/-dRJgjsKWKaYjNmXqNAxz3LqIyE=/54x81/dkpu1ddg7pbsk.cloudfront.net/movie/11/18/06/11180668_ori.jpg","profile":"http://resizing.flixster.com/-dRJgjsKWKaYjNmXqNAxz3LqIyE=/54x81/dkpu1ddg7pbsk.cloudfront.net/movie/11/18/06/11180668_ori.jpg","detailed":"http://resizing.flixster.com/-dRJgjsKWKaYjNmXqNAxz3LqIyE=/54x81/dkpu1ddg7pbsk.cloudfront.net/movie/11/18/06/11180668_ori.jpg","original":"http://resizing.flixster.com/-dRJgjsKWKaYjNmXqNAxz3LqIyE=/54x81/dkpu1ddg7pbsk.cloudfront.net/movie/11/18/06/11180668_ori.jpg"},"abridged_cast":[{"name":"Eminem","id":"162688835","characters":["Jimmy
476
+ `Rabbit'' Smith"]},{"name":"Kim Basinger","id":"162664684","characters":["Stephanie"]},{"name":"Mekhi
477
+ Phifer","id":"162667293","characters":["Future"]},{"name":"Brittany Murphy","id":"162666533","characters":["Alex"]},{"name":"Evan
478
+ Jones","id":"364627387","characters":["Cheddar Bob"]}],"alternate_ids":{"imdb":"0298203"},"links":{"self":"http://api.rottentomatoes.com/api/public/v1.0/movies/13198.json","alternate":"http://www.rottentomatoes.com/m/8_mile/","cast":"http://api.rottentomatoes.com/api/public/v1.0/movies/13198/cast.json","reviews":"http://api.rottentomatoes.com/api/public/v1.0/movies/13198/reviews.json","similar":"http://api.rottentomatoes.com/api/public/v1.0/movies/13198/similar.json"}}],"links":{"self":"http://api.rottentomatoes.com/api/public/v1.0/movies.json?q=8+Mile+2002&page_limit=1&page=1","next":"http://api.rottentomatoes.com/api/public/v1.0/movies.json?q=8+Mile+2002&page_limit=1&page=2"},"link_template":"http://api.rottentomatoes.com/api/public/v1.0/movies.json?q={search-term}&page_limit={results-per-page}&page={page-number}"}
479
+
480
+ '
481
+ http_version:
482
+ recorded_at: Fri, 08 May 2015 12:14:36 GMT
483
+ - request:
484
+ method: get
485
+ uri: http://api.rottentomatoes.com/api/public/v1.0/movies.json?apikey=ww8qgxbhjbqudvupbr8sqd7x&page_limit=1&q=12%20Years%20a%20Slave%202013
486
+ body:
487
+ encoding: US-ASCII
488
+ string: ''
489
+ headers:
490
+ User-Agent:
491
+ - Faraday v0.9.1
492
+ response:
493
+ status:
494
+ code: 200
495
+ message: OK
496
+ headers:
497
+ Content-Language:
498
+ - en-US
499
+ Content-Type:
500
+ - text/javascript;charset=ISO-8859-1
501
+ Date:
502
+ - Fri, 08 May 2015 12:06:05 GMT
503
+ Flx-Build-Date:
504
+ - '2015-05-07 12:53:20'
505
+ Flx-Commit:
506
+ - JOBRELEASE.2015-05-07.12-25-31 3a929c5
507
+ Flx-Server:
508
+ - web238.flixster.com
509
+ Rt-Commit:
510
+ - 2001eec
511
+ Server:
512
+ - Mashery Proxy
513
+ Set-Cookie:
514
+ - JSESSIONID=481A5C3A16E27D6F8F76CD03794AED09; Path=/; HttpOnly
515
+ Vary:
516
+ - User-Agent,Accept-Encoding
517
+ X-Mashery-Responder:
518
+ - prod-j-worker-us-east-1d-69.mashery.com
519
+ Content-Length:
520
+ - '2321'
521
+ Connection:
522
+ - keep-alive
523
+ body:
524
+ encoding: US-ASCII
525
+ string: ! '
526
+
527
+
528
+
529
+
530
+
531
+
532
+
533
+
534
+
535
+
536
+
537
+
538
+
539
+
540
+
541
+
542
+
543
+
544
+
545
+
546
+
547
+
548
+
549
+
550
+
551
+
552
+
553
+
554
+
555
+
556
+
557
+
558
+ {"total":1,"movies":[{"id":"771316210","title":"12 Years a Slave","year":2013,"mpaa_rating":"R","runtime":134,"critics_consensus":"","release_dates":{"theater":"2013-10-18","dvd":"2014-03-04"},"ratings":{"critics_rating":"Certified
559
+ Fresh","critics_score":96,"audience_rating":"Upright","audience_score":90},"synopsis":"Chiwetel
560
+ Ejiofor stars as Solomon Northup, the New York State citizen who was kidnapped
561
+ and made to work on a plantation in New Orleans in the 1800s. Steve McQueen
562
+ (Hunger) directs from a script he co-wrote with John Ridley, based in part
563
+ by Northup''s memoir. Michael Fassbender, Brad Pitt, Benedict Cumberbatch,
564
+ Sarah Paulson, and Paul Giamatti co-star. ~ Jeremy Wheeler, Rovi","posters":{"thumbnail":"http://resizing.flixster.com/8_gLS69ly81CAMZBpcGJMbKGja0=/54x81/dkpu1ddg7pbsk.cloudfront.net/movie/11/17/64/11176495_ori.jpg","profile":"http://resizing.flixster.com/8_gLS69ly81CAMZBpcGJMbKGja0=/54x81/dkpu1ddg7pbsk.cloudfront.net/movie/11/17/64/11176495_ori.jpg","detailed":"http://resizing.flixster.com/8_gLS69ly81CAMZBpcGJMbKGja0=/54x81/dkpu1ddg7pbsk.cloudfront.net/movie/11/17/64/11176495_ori.jpg","original":"http://resizing.flixster.com/8_gLS69ly81CAMZBpcGJMbKGja0=/54x81/dkpu1ddg7pbsk.cloudfront.net/movie/11/17/64/11176495_ori.jpg"},"abridged_cast":[{"name":"Lupita
565
+ Nyongo''o","id":"771524199"},{"name":"Chiwetel Ejiofor","id":"162654272","characters":["Solomon
566
+ Northup"]},{"name":"Michael Fassbender","id":"364641814","characters":["Edwin
567
+ Epps"]},{"name":"Benedict Cumberbatch","id":"355028249","characters":["Ford"]},{"name":"Paul
568
+ Giamatti","id":"162683649","characters":["Freeman"]}],"links":{"self":"http://api.rottentomatoes.com/api/public/v1.0/movies/771316210.json","alternate":"http://www.rottentomatoes.com/m/12_years_a_slave/","cast":"http://api.rottentomatoes.com/api/public/v1.0/movies/771316210/cast.json","reviews":"http://api.rottentomatoes.com/api/public/v1.0/movies/771316210/reviews.json","similar":"http://api.rottentomatoes.com/api/public/v1.0/movies/771316210/similar.json"}}],"links":{"self":"http://api.rottentomatoes.com/api/public/v1.0/movies.json?q=12+Years+a+Slave+2013&page_limit=1&page=1"},"link_template":"http://api.rottentomatoes.com/api/public/v1.0/movies.json?q={search-term}&page_limit={results-per-page}&page={page-number}"}
569
+
570
+ '
571
+ http_version:
572
+ recorded_at: Fri, 08 May 2015 12:14:36 GMT
573
+ - request:
574
+ method: get
575
+ uri: http://api.rottentomatoes.com/api/public/v1.0/movies.json?apikey=ww8qgxbhjbqudvupbr8sqd7x&page_limit=1&q=20%20Feet%20from%20Stardom%202013
576
+ body:
577
+ encoding: US-ASCII
578
+ string: ''
579
+ headers:
580
+ User-Agent:
581
+ - Faraday v0.9.1
582
+ response:
583
+ status:
584
+ code: 200
585
+ message: OK
586
+ headers:
587
+ Content-Language:
588
+ - en-US
589
+ Content-Type:
590
+ - text/javascript;charset=ISO-8859-1
591
+ Date:
592
+ - Fri, 08 May 2015 12:06:05 GMT
593
+ Flx-Build-Date:
594
+ - '2015-05-07 12:53:20'
595
+ Flx-Commit:
596
+ - JOBRELEASE.2015-05-07.12-25-31 3a929c5
597
+ Flx-Server:
598
+ - web235.flixster.com
599
+ Rt-Commit:
600
+ - 2001eec
601
+ Server:
602
+ - Mashery Proxy
603
+ Set-Cookie:
604
+ - JSESSIONID=DFC326FDFF7BF8310CD5E3AFD1BC55DD; Path=/; HttpOnly
605
+ Vary:
606
+ - User-Agent,Accept-Encoding
607
+ X-Mashery-Responder:
608
+ - prod-j-worker-us-east-1e-75.mashery.com
609
+ Content-Length:
610
+ - '2929'
611
+ Connection:
612
+ - keep-alive
613
+ body:
614
+ encoding: US-ASCII
615
+ string: ! '
616
+
617
+
618
+
619
+
620
+
621
+
622
+
623
+
624
+
625
+
626
+
627
+
628
+
629
+
630
+
631
+
632
+
633
+
634
+
635
+
636
+
637
+
638
+
639
+
640
+
641
+
642
+
643
+
644
+
645
+
646
+
647
+
648
+ {"total":1,"movies":[{"id":"771325066","title":"20 Feet From Stardom","year":2013,"mpaa_rating":"PG-13","runtime":89,"critics_consensus":"","release_dates":{"theater":"2013-06-14","dvd":"2014-01-14"},"ratings":{"critics_rating":"Certified
649
+ Fresh","critics_score":99,"audience_rating":"Upright","audience_score":82},"synopsis":"Millions
650
+ know their voices, but no one knows their names. In his compelling new film
651
+ 20 FEET FROM STARDOM, award-winning director Morgan Neville shines a spotlight
652
+ on the untold true story of the backup singers behind some of the greatest
653
+ musical legends of the 21st century. Triumphant and heartbreaking in equal
654
+ measure, the film is both a tribute to the unsung voices who brought shape
655
+ and style to popular music and a reflection on the conflicts, sacrifices and
656
+ rewards of a career spent harmonizing with others. These gifted artists span
657
+ a range of styles, genres and eras of popular music, but each has a uniquely
658
+ fascinating and personal story to share of life spent in the shadows of superstardom.
659
+ Along with rare archival footage and a peerless soundtrack, 20 FEET FROM STARDOM
660
+ boasts intimate interviews with Bruce Springsteen, Stevie Wonder, Mick Jagger
661
+ and Sting to name just a few. However, these world-famous figures take a backseat
662
+ to the diverse array of backup singers whose lives and stories take center
663
+ stage in the film. (c) TWC-Radius","posters":{"thumbnail":"http://resizing.flixster.com/l2mq3vN48iop1SnEYU3DVTe5A2Q=/54x77/dkpu1ddg7pbsk.cloudfront.net/movie/11/17/16/11171622_ori.jpg","profile":"http://resizing.flixster.com/l2mq3vN48iop1SnEYU3DVTe5A2Q=/54x77/dkpu1ddg7pbsk.cloudfront.net/movie/11/17/16/11171622_ori.jpg","detailed":"http://resizing.flixster.com/l2mq3vN48iop1SnEYU3DVTe5A2Q=/54x77/dkpu1ddg7pbsk.cloudfront.net/movie/11/17/16/11171622_ori.jpg","original":"http://resizing.flixster.com/l2mq3vN48iop1SnEYU3DVTe5A2Q=/54x77/dkpu1ddg7pbsk.cloudfront.net/movie/11/17/16/11171622_ori.jpg"},"abridged_cast":[{"name":"Bette
664
+ Midler","id":"162659059"},{"name":"Lesley Miller","id":"770702774"},{"name":"Arnold
665
+ McCuller","id":"770743426"},{"name":"Janice Pendarvis","id":"770968336"},{"name":"Nicki
666
+ Richards","id":"770783306"}],"alternate_ids":{"imdb":"2396566"},"links":{"self":"http://api.rottentomatoes.com/api/public/v1.0/movies/771325066.json","alternate":"http://www.rottentomatoes.com/m/20_feet_from_stardom/","cast":"http://api.rottentomatoes.com/api/public/v1.0/movies/771325066/cast.json","reviews":"http://api.rottentomatoes.com/api/public/v1.0/movies/771325066/reviews.json","similar":"http://api.rottentomatoes.com/api/public/v1.0/movies/771325066/similar.json"}}],"links":{"self":"http://api.rottentomatoes.com/api/public/v1.0/movies.json?q=20+Feet+from+Stardom+2013&page_limit=1&page=1"},"link_template":"http://api.rottentomatoes.com/api/public/v1.0/movies.json?q={search-term}&page_limit={results-per-page}&page={page-number}"}
667
+
668
+ '
669
+ http_version:
670
+ recorded_at: Fri, 08 May 2015 12:14:36 GMT
671
+ recorded_with: VCR 2.9.3