jobparser 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/jobparser/facets/deadline.rb +24 -0
- data/lib/jobparser/facets/facet.rb +3 -1
- data/lib/jobparser/parsehtml.rb +4 -0
- data/lib/jobparser/parser.rb +2 -1
- data/lib/jobparser/parseschema.rb +4 -0
- data/lib/jobparser/specialcases.rb +11 -0
- data/lib/jobparser/version.rb +1 -1
- data/lib/jobparser.rb +1 -0
- metadata +3 -2
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'date'
|
2
|
+
|
3
|
+
module JobParser
|
4
|
+
module Facets
|
5
|
+
class Deadline < Facet
|
6
|
+
def parse
|
7
|
+
special_case_result = use_special_case(:deadline)
|
8
|
+
return special_case_result unless special_case_result.nil?
|
9
|
+
|
10
|
+
regex = /(Apply before|Closing Date):\s*(.+)$/i
|
11
|
+
loop_over_elements { |name, elem|
|
12
|
+
regex.match(elem.content) { |m|
|
13
|
+
return Cleaner.strip_all_white_space(m[2])
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
regex.match(@plain_text) { |m|
|
18
|
+
# return Cleaner.strip_all_white_space(m[2])
|
19
|
+
}
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/jobparser/parsehtml.rb
CHANGED
data/lib/jobparser/parser.rb
CHANGED
@@ -38,6 +38,17 @@ module JobParser
|
|
38
38
|
}
|
39
39
|
salary
|
40
40
|
}
|
41
|
+
},
|
42
|
+
"bfi.org.uk" => {
|
43
|
+
:deadline => Proc.new { |doc|
|
44
|
+
match = ""
|
45
|
+
doc.css(".block-container>p").each do |p|
|
46
|
+
/The closing date for this position is (.+)\./.match(p.content) { |m|
|
47
|
+
match = m[1]
|
48
|
+
}
|
49
|
+
end
|
50
|
+
match
|
51
|
+
}
|
41
52
|
}
|
42
53
|
}
|
43
54
|
end
|
data/lib/jobparser/version.rb
CHANGED
data/lib/jobparser.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.
|
4
|
+
version: 0.5.0
|
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-07-
|
12
|
+
date: 2013-07-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -100,6 +100,7 @@ extra_rdoc_files: []
|
|
100
100
|
files:
|
101
101
|
- lib/jobparser/cleaner.rb
|
102
102
|
- lib/jobparser/facets/apply.rb
|
103
|
+
- lib/jobparser/facets/deadline.rb
|
103
104
|
- lib/jobparser/facets/facet.rb
|
104
105
|
- lib/jobparser/facets/location.rb
|
105
106
|
- lib/jobparser/facets/salary.rb
|