jobparser 0.13.2 → 0.13.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/jobparser.rb +11 -5
- data/lib/jobparser/error.rb +6 -0
- data/lib/jobparser/version.rb +1 -1
- metadata +3 -2
data/lib/jobparser.rb
CHANGED
@@ -16,6 +16,7 @@ require "jobparser/facets/location"
|
|
16
16
|
require "jobparser/facets/apply"
|
17
17
|
require "jobparser/facets/title"
|
18
18
|
require "jobparser/facets/deadline"
|
19
|
+
require "jobparser/error"
|
19
20
|
|
20
21
|
require "open-uri"
|
21
22
|
|
@@ -36,12 +37,17 @@ module JobParser
|
|
36
37
|
end
|
37
38
|
else
|
38
39
|
# we only need the HTML if there's no cache
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
40
|
+
begin
|
41
|
+
html = open(url, :allow_redirections => :safe).read
|
42
|
+
if html.include?("http://schema.org/JobPosting")
|
43
|
+
ParseSchema.new(html, url)
|
44
|
+
else
|
45
|
+
ParseHtml.new(html, url)
|
46
|
+
end
|
47
|
+
rescue URI::InvalidURIError
|
48
|
+
raise JobParser::Error::InvalidUrl, "The URI given was not valid"
|
44
49
|
end
|
50
|
+
|
45
51
|
end
|
46
52
|
|
47
53
|
end
|
data/lib/jobparser/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jobparser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-08-
|
12
|
+
date: 2013-08-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- lib/jobparser/cache/textfile.rb
|
151
151
|
- lib/jobparser/cache.rb
|
152
152
|
- lib/jobparser/cleaner.rb
|
153
|
+
- lib/jobparser/error.rb
|
153
154
|
- lib/jobparser/facets/apply.rb
|
154
155
|
- lib/jobparser/facets/deadline.rb
|
155
156
|
- lib/jobparser/facets/facet.rb
|