scrapers 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scrapers/gocomics.rb +7 -1
- data/lib/scrapers/version.rb +1 -1
- metadata +1 -2
- data/.watchr +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ed963b518db6e326e8f86caf549821942e95248
|
4
|
+
data.tar.gz: fec6828d9b6b9923d0f595852accb4ba282454a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 644b43272415ef5c765bd75d9e788564f861430b84914aa79e37f664f691eb1436f7b98934283521331d6411da51605af2c8937f9d4a1b856686badf454cf1e0
|
7
|
+
data.tar.gz: e47dc6eadcd7c7ca05197cdff5e19c60010e760380264c1bf515f832fa814bc7bde29d7c02df980b239dae75507198dc9b6b27a40840ada8398d7f09065a2f5d
|
data/lib/scrapers/gocomics.rb
CHANGED
@@ -12,15 +12,21 @@ module Scrapers
|
|
12
12
|
|
13
13
|
results = Hash.new
|
14
14
|
|
15
|
+
results[:comic] = comic
|
16
|
+
|
15
17
|
url = URI.parse GOCOMIC_URL
|
16
18
|
url.path = "/#{comic}"
|
17
19
|
|
18
|
-
page = Nokogiri::HTML(open(url.to_s))
|
19
20
|
results[:url] = url.to_s
|
21
|
+
|
22
|
+
page = Nokogiri::HTML(open(url.to_s))
|
23
|
+
|
20
24
|
results[:title] = scrape_title(page)
|
21
25
|
results[:pubdate] = scrape_pubdate(page)
|
22
26
|
results[:img_src] = scrape_image_source(page)
|
27
|
+
|
23
28
|
results
|
29
|
+
|
24
30
|
end
|
25
31
|
|
26
32
|
def self.scrape_title(page)
|
data/lib/scrapers/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scrapers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tamara Temple
|
@@ -132,7 +132,6 @@ extra_rdoc_files: []
|
|
132
132
|
files:
|
133
133
|
- .gitignore
|
134
134
|
- .rspec-example
|
135
|
-
- .watchr
|
136
135
|
- Gemfile
|
137
136
|
- Guardfile
|
138
137
|
- LICENSE.txt
|
data/.watchr
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
def run_spec(file)
|
3
|
-
unless File.exist?(file)
|
4
|
-
puts "#{file} does not exist"
|
5
|
-
return
|
6
|
-
end
|
7
|
-
|
8
|
-
puts "Running #{file}"
|
9
|
-
system "bundle exec rspec #{file}"
|
10
|
-
puts
|
11
|
-
end
|
12
|
-
|
13
|
-
watch("^spec/*_spec.rb$") do |match|
|
14
|
-
run_spec match[0]
|
15
|
-
end
|
16
|
-
|
17
|
-
watch("^spec/.*/*_spec.rb$") do |match|
|
18
|
-
run_spec match[0]
|
19
|
-
end
|
20
|
-
|
21
|
-
watch("^lib/(.*).rb$") do |match|
|
22
|
-
run_spec "spec/#{match[1]}_spec.rb"
|
23
|
-
end
|
24
|
-
|
25
|
-
watch("^lib/(.*/.*).rb$") do |match|
|
26
|
-
run_spec "spec/#{match[1]}_spec.rb"
|
27
|
-
end
|