scrapers 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scrapers/version.rb +1 -1
- data/lib/scrapers/xkcd.rb +2 -2
- data/spec/scrapers/xkcd_spec.rb +3 -2
- 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: 6fb804c177c8883db20c25ec49ec1bb6cf54572b
|
4
|
+
data.tar.gz: c6c2c87ea1f501ace31a0b2e66a90ff57ba9708e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a1fcb7886a93bc4cd7f881367d3cfbe3f74771f69b58ae9cf0c74bb29ff0d9db31986e177ebaa04b852c9bf949fe1b55ab3ce4e9e9f7f51eefe62aa91d713a0
|
7
|
+
data.tar.gz: 053b85c2d9a801e27d5d12fe2a81ead56c9e77c54ae9064ed4db1792d29e9e936dc2edee936cb97aba6e1f2a025b536ba0e6345836f80e123d8453fa83066d20
|
data/lib/scrapers/version.rb
CHANGED
data/lib/scrapers/xkcd.rb
CHANGED
@@ -30,8 +30,8 @@ module Scrapers
|
|
30
30
|
doc = Nokogiri::HTML(open(url.to_s))
|
31
31
|
comic = doc.at_css("#comic img")
|
32
32
|
results[:img_src] = comic.attr("src")
|
33
|
-
results[:
|
34
|
-
results[:title] = comic.attr("alt")
|
33
|
+
results[:img_title] = comic.attr("title")
|
34
|
+
results[:title] = results[:img_alt] = comic.attr("alt")
|
35
35
|
results[:pubdate] = get_pubdate(results[:img_src])
|
36
36
|
|
37
37
|
results
|
data/spec/scrapers/xkcd_spec.rb
CHANGED
@@ -11,8 +11,9 @@ describe Scrapers::Xkcd do
|
|
11
11
|
:title => "Sandwich",
|
12
12
|
:url => "http://xkcd.com/149/",
|
13
13
|
:img_src => "http://imgs.xkcd.com/comics/sandwich.png",
|
14
|
-
:
|
15
|
-
:
|
14
|
+
:img_title => "Proper User Policy apparently means Simon Says.",
|
15
|
+
:img_alt => "Sandwich",
|
16
|
+
:pubdate => "2010-02-01",
|
16
17
|
}
|
17
18
|
end
|
18
19
|
it "should retrieve the comic" do
|