scrapers 1.0.0 → 1.1.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/esod.rb +29 -0
- data/lib/scrapers/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4807185dd0cee3d545e7db022cc5d310298e8792
|
4
|
+
data.tar.gz: d39450c7f4f6325eb73a864bdb476a9af3177d7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a32d5e6a3cad4644a5a4ee34e817d650aeff240152e60a875562fc465697221676598f67d6b13707201ac014d5634afce4c1177571d2fea802c74b8295bbed4
|
7
|
+
data.tar.gz: 67e51797361ad9c21dcc8d7c3200f3f3190ca98ce5402359f51aaefced4f41a34fadd8912e45480c49ce49e0baed2558570734413fa96e6f35f56f355011ed60
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Scrapers
|
2
|
+
|
3
|
+
module Esod
|
4
|
+
|
5
|
+
module_function
|
6
|
+
|
7
|
+
def scrape(url=nil)
|
8
|
+
esod = Hash.new
|
9
|
+
Mechanize.start do |m|
|
10
|
+
|
11
|
+
m.get url
|
12
|
+
|
13
|
+
m.current_page.tap do |page|
|
14
|
+
esod[:title] = page.title.strip
|
15
|
+
esod[:link] = page.uri.to_s
|
16
|
+
esod[:description] = page.search(".entry-body").first.text
|
17
|
+
esod[:pubDate] = page.response['date'].to_s
|
18
|
+
esod[:guid] = page.uri.to_s
|
19
|
+
esod[:content_encoded] = page.search(".entry-body").first
|
20
|
+
esod[:image] = page.image_with(:dom_class => %r{\basset\b}).src
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
esod
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
data/lib/scrapers/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scrapers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tamara Temple
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- lib/scrapers/allrecipes.rb
|
142
142
|
- lib/scrapers/discoverynews.rb
|
143
143
|
- lib/scrapers/download.rb
|
144
|
+
- lib/scrapers/esod.rb
|
144
145
|
- lib/scrapers/gocomics.rb
|
145
146
|
- lib/scrapers/imgur.rb
|
146
147
|
- lib/scrapers/nasa_apod.rb
|
@@ -186,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
187
|
version: '0'
|
187
188
|
requirements: []
|
188
189
|
rubyforge_project:
|
189
|
-
rubygems_version: 2.0.
|
190
|
+
rubygems_version: 2.0.14
|
190
191
|
signing_key:
|
191
192
|
specification_version: 4
|
192
193
|
summary: Web site scrapers
|