metainspector 1.8.8 → 1.8.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/meta_inspector/scraper.rb +6 -3
- data/lib/meta_inspector/version.rb +1 -1
- data/meta_inspector.gemspec +3 -3
- data/samples/spider.rb +1 -0
- metadata +15 -15
@@ -3,7 +3,6 @@
|
|
3
3
|
require 'open-uri'
|
4
4
|
require 'nokogiri'
|
5
5
|
require 'charguess'
|
6
|
-
require 'iconv'
|
7
6
|
require 'hashie/rash'
|
8
7
|
|
9
8
|
# MetaInspector provides an easy way to scrape web pages and get its elements
|
@@ -86,8 +85,9 @@ module MetaInspector
|
|
86
85
|
def parsed_document
|
87
86
|
@parsed_document ||= Nokogiri::HTML(document)
|
88
87
|
|
89
|
-
rescue
|
88
|
+
rescue Exception => e
|
90
89
|
warn 'An exception occurred while trying to scrape the page!'
|
90
|
+
warn e.message
|
91
91
|
end
|
92
92
|
|
93
93
|
# Returns the original, unparsed document
|
@@ -99,8 +99,11 @@ module MetaInspector
|
|
99
99
|
@scraped = false
|
100
100
|
rescue TimeoutError
|
101
101
|
warn 'Timeout!!!'
|
102
|
-
|
102
|
+
@scraped = false
|
103
|
+
rescue Exception => e
|
103
104
|
warn 'An exception occurred while trying to fetch the page!'
|
105
|
+
warn e.message
|
106
|
+
@scraped = false
|
104
107
|
end
|
105
108
|
|
106
109
|
# Scrapers for all meta_tags in the form of "meta_name" are automatically defined. This has been tested for
|
data/meta_inspector.gemspec
CHANGED
@@ -14,12 +14,12 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.require_paths = ["lib"]
|
15
15
|
gem.version = MetaInspector::VERSION
|
16
16
|
|
17
|
-
gem.add_dependency 'nokogiri', '1.5.
|
17
|
+
gem.add_dependency 'nokogiri', '1.5.3'
|
18
18
|
gem.add_dependency 'charguess', '1.3.20111021164500'
|
19
19
|
gem.add_dependency 'rash', '0.3.2'
|
20
20
|
|
21
|
-
gem.add_development_dependency 'rspec', '2.
|
21
|
+
gem.add_development_dependency 'rspec', '2.10.0'
|
22
22
|
gem.add_development_dependency 'fakeweb', '1.3.0'
|
23
|
-
gem.add_development_dependency 'awesome_print', '0.
|
23
|
+
gem.add_development_dependency 'awesome_print', '1.0.2'
|
24
24
|
gem.add_development_dependency 'rake', '0.9.2.2'
|
25
25
|
end
|
data/samples/spider.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metainspector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 37
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 1.8.
|
9
|
+
- 9
|
10
|
+
version: 1.8.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jaime Iniesta
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-06-03 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: nokogiri
|
@@ -25,12 +25,12 @@ dependencies:
|
|
25
25
|
requirements:
|
26
26
|
- - "="
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
28
|
+
hash: 5
|
29
29
|
segments:
|
30
30
|
- 1
|
31
31
|
- 5
|
32
|
-
-
|
33
|
-
version: 1.5.
|
32
|
+
- 3
|
33
|
+
version: 1.5.3
|
34
34
|
type: :runtime
|
35
35
|
version_requirements: *id001
|
36
36
|
- !ruby/object:Gem::Dependency
|
@@ -73,12 +73,12 @@ dependencies:
|
|
73
73
|
requirements:
|
74
74
|
- - "="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
hash:
|
76
|
+
hash: 39
|
77
77
|
segments:
|
78
78
|
- 2
|
79
|
-
-
|
79
|
+
- 10
|
80
80
|
- 0
|
81
|
-
version: 2.
|
81
|
+
version: 2.10.0
|
82
82
|
type: :development
|
83
83
|
version_requirements: *id004
|
84
84
|
- !ruby/object:Gem::Dependency
|
@@ -105,12 +105,12 @@ dependencies:
|
|
105
105
|
requirements:
|
106
106
|
- - "="
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
hash:
|
108
|
+
hash: 19
|
109
109
|
segments:
|
110
|
+
- 1
|
110
111
|
- 0
|
111
|
-
-
|
112
|
-
|
113
|
-
version: 0.4.0
|
112
|
+
- 2
|
113
|
+
version: 1.0.2
|
114
114
|
type: :development
|
115
115
|
version_requirements: *id006
|
116
116
|
- !ruby/object:Gem::Dependency
|
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
193
|
requirements: []
|
194
194
|
|
195
195
|
rubyforge_project:
|
196
|
-
rubygems_version: 1.8.
|
196
|
+
rubygems_version: 1.8.15
|
197
197
|
signing_key:
|
198
198
|
specification_version: 3
|
199
199
|
summary: MetaInspector is a ruby gem for web scraping purposes, that returns a hash with metadata from a given URL
|