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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 960eadf205104f76a6be3e1bf820dd3bb401fae8
4
- data.tar.gz: 56ec817fe56cbe1adc9f82060b5fe8d5b96222be
3
+ metadata.gz: 4807185dd0cee3d545e7db022cc5d310298e8792
4
+ data.tar.gz: d39450c7f4f6325eb73a864bdb476a9af3177d7a
5
5
  SHA512:
6
- metadata.gz: fa018e7d9a1ca5faeebca9eb478832784fa3cb377b8b382f6a1d7c28299e1df31297eeeb70a0031748de0f1ce1b7e19d6348ddbeb853e73bda88f760b2db6ab3
7
- data.tar.gz: 223214a05801135f0e5df20d60393104a865c9446cdcb40d810a08d764bb73202ba4902e642531a3ffb81470611fd20a4c581e7a6074c37dde97e3d49921b900
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
@@ -2,7 +2,7 @@ module Scrapers
2
2
  module Version
3
3
 
4
4
  MAJOR = 1
5
- MINOR = 0
5
+ MINOR = 1
6
6
  BUILD = 0
7
7
 
8
8
  end
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.0.0
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: 2013-10-20 00:00:00.000000000 Z
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.3
190
+ rubygems_version: 2.0.14
190
191
  signing_key:
191
192
  specification_version: 4
192
193
  summary: Web site scrapers