worth_watching 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/worth_watching/aggregator.rb +2 -2
- data/lib/worth_watching/version.rb +1 -1
- data/spec/unit/aggregator_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbe2f73035e78be1cef282aed466d0c4c73cedd6
|
4
|
+
data.tar.gz: 84ef48e063eaaccc5b2d703c44c13254d79b1901
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83ecc37172b01cb65dd9971a37e74abc5cd09a51662e240bc1e3c36ce337d8c192e4b4d7fa41fc1e2710f642a3f50826f98076741cc01355eef17cdfa8b17b16
|
7
|
+
data.tar.gz: 63eda6ed675dfd738f3bf022de6989741a809972b30f46b8624b8d7f6d5d66fa883004fa2124609933fd95bc667ccae7c8a02b7ddaca7ae51d6966521509d34f
|
@@ -99,7 +99,7 @@ module WorthWatching
|
|
99
99
|
|
100
100
|
# Retrieves and updates the current movie's IMDb rating
|
101
101
|
def retrieve_imdb_info
|
102
|
-
omdb_response = JSON.parse(Typhoeus.get("http://www.omdbapi.com/?i=tt#{@movie.imdb_id}
|
102
|
+
omdb_response = JSON.parse(Typhoeus.get("http://www.omdbapi.com/?i=tt#{@movie.imdb_id}").body)
|
103
103
|
|
104
104
|
if omdb_response["Response"] == "True"
|
105
105
|
if omdb_response["imdbRating"] == "N/A"
|
@@ -132,7 +132,7 @@ module WorthWatching
|
|
132
132
|
|
133
133
|
# Scrapes and sets the IMDb rating of the current movie from its IMDb page
|
134
134
|
def scrape_imdb_rating
|
135
|
-
imdb_url = "http://m.imdb.com/title/tt#{@movie.imdb_id}"
|
135
|
+
imdb_url = "http://m.imdb.com/title/tt#{@movie.imdb_id}/"
|
136
136
|
|
137
137
|
imdb_page = Nokogiri::HTML(Typhoeus.get(imdb_url).body)
|
138
138
|
|
@@ -105,7 +105,7 @@ describe 'WorthWatching::Aggregator' do
|
|
105
105
|
stub_request(:get, "http://www.metacritic.com/search/movie/Captain+America:+The+Winter+Soldier/results").to_return(:status => 200, :body => json_response,:headers => {"content-type"=>["text/html; charset=utf-8"]})
|
106
106
|
|
107
107
|
json_response = File.read(File.dirname(__FILE__) + "/../support/html_responses/captain_america_imdb.html")
|
108
|
-
stub_request(:get, "http://m.imdb.com/title/tt1843866").to_return(:status => 200, :body => json_response,:headers => {"content-type"=>["text/html; charset=utf-8"]})
|
108
|
+
stub_request(:get, "http://m.imdb.com/title/tt1843866/").to_return(:status => 200, :body => json_response,:headers => {"content-type"=>["text/html; charset=utf-8"]})
|
109
109
|
end
|
110
110
|
|
111
111
|
it "scrapes the rating directly from the movie's IMDb page" do
|