career_builder 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +5 -0
- data/.gitignore +22 -0
- data/Gemfile +10 -0
- data/LICENSE +20 -0
- data/README.md +91 -0
- data/Rakefile +48 -0
- data/VERSION +1 -0
- data/career_builder.gemspec +95 -0
- data/lib/career_builder.rb +39 -0
- data/lib/career_builder/api/company.rb +17 -0
- data/lib/career_builder/api/interest.rb +16 -0
- data/lib/career_builder/api/job_type.rb +15 -0
- data/lib/career_builder/api/language.rb +15 -0
- data/lib/career_builder/api/location.rb +19 -0
- data/lib/career_builder/api/pay.rb +16 -0
- data/lib/career_builder/api/resume.rb +67 -0
- data/lib/career_builder/api/resume_search.rb +22 -0
- data/lib/career_builder/api/resume_search_result.rb +28 -0
- data/lib/career_builder/api/school.rb +18 -0
- data/lib/career_builder/api/shift_preference.rb +15 -0
- data/lib/career_builder/api/word_document.rb +16 -0
- data/lib/career_builder/client.rb +37 -0
- data/lib/career_builder/errors.rb +7 -0
- data/lib/career_builder/request.rb +82 -0
- data/lib/career_builder/request/authenticated.rb +23 -0
- data/lib/career_builder/requests/advanced_resume_search.rb +41 -0
- data/lib/career_builder/requests/authentication.rb +25 -0
- data/lib/career_builder/requests/get_resume.rb +24 -0
- data/lib/career_builder/requests/resume_actions_remaining_today.rb +21 -0
- data/lib/career_builder/resume.rb +44 -0
- data/lib/career_builder/resume/lazy_collection.rb +39 -0
- data/spec/career_builder/client_spec.rb +554 -0
- data/spec/career_builder/resume/lazy_collection_spec.rb +30 -0
- data/spec/career_builder/resume_spec.rb +5 -0
- data/spec/career_builder_spec.rb +5 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +13 -0
- data/spec/support/webmock.rb +7 -0
- metadata +169 -0
data/.document
ADDED
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Michael Guterl
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
# CareerBuilder
|
2
|
+
|
3
|
+
Ruby wrapper for the [CareerBuilder V2 HTTP XML API](http://ws.careerbuilder.com/schemas/). While the CareerBuilder::Client mimics the interface of the HTTP API, it also provides some convenience methods to make your life easier.
|
4
|
+
|
5
|
+
**NOTE** currently only the resume portion of the API is implemented, others are a work in progress.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
gem install career_builder
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
require 'career_builder'
|
14
|
+
|
15
|
+
### Authenticate
|
16
|
+
|
17
|
+
client = CareerBuilder.new('your_email', 'your_password')
|
18
|
+
session_token = client.authenticate
|
19
|
+
|
20
|
+
### Resume API
|
21
|
+
|
22
|
+
http://ws.careerbuilder.com/resumes/resumes.asmx
|
23
|
+
|
24
|
+
#### advanced_resume_search
|
25
|
+
|
26
|
+
resumes = client.advanced_resume_search(:keywords => "Ruby",
|
27
|
+
:zip_code => "45140",
|
28
|
+
:search_radius_in_miles => 50)
|
29
|
+
|
30
|
+
#### get_resume
|
31
|
+
|
32
|
+
partial_resume = resumes.first
|
33
|
+
resume = client.get_resume(:resume_id => partial_resume.id)
|
34
|
+
|
35
|
+
#### resume_actions_remaining_today
|
36
|
+
|
37
|
+
This method requires your AccountDID, I could not find an official way to find this identifier, but I followed these steps:
|
38
|
+
|
39
|
+
1. Sign into CareerBuilder with your email / password credentials
|
40
|
+
2. Click My CareerBuilder -> My Account Info
|
41
|
+
3. Copy the AccountDID URL parameter from your address bar
|
42
|
+
|
43
|
+
client.resume_actions_remaining_today(:account_did => "D7C10Q67ZKG123VCRMC") # => 42
|
44
|
+
|
45
|
+
### Resume Convenience Methods / Classes
|
46
|
+
|
47
|
+
fetch a lazy collection of resumes, nothing actually happens until you iterate.
|
48
|
+
|
49
|
+
resumes = client.resumes(:keywords => "Ruby",
|
50
|
+
:zip_code => "45140",
|
51
|
+
:search_radius_in_miles => 50)
|
52
|
+
|
53
|
+
iterate through the resumes, automatically paging through the result set.
|
54
|
+
|
55
|
+
resumes.each do |resume|
|
56
|
+
puts resume.id
|
57
|
+
end
|
58
|
+
|
59
|
+
resumes that are fetched from a Resume::LazyCollection are also lazy in the sense that they do not attempt to use the Client#get_resume method until you access one of the attributes that requires using an API credit.
|
60
|
+
|
61
|
+
resume = resumes.first
|
62
|
+
|
63
|
+
Client#get_resume is not called when retrieving the id
|
64
|
+
|
65
|
+
resume.id # => "42XXASDFJKLQWERTY"
|
66
|
+
|
67
|
+
Client#get_resume(:resume_id => "42XXASDFJKLQWERTY") is called behind the scenes in order to fetch the real email address associated with the resume.
|
68
|
+
|
69
|
+
resume.real_contact_email # => "michael@jordan.com"
|
70
|
+
|
71
|
+
## TODO
|
72
|
+
|
73
|
+
* More / better specs
|
74
|
+
* Implement Application Web Service
|
75
|
+
* Implement Job Web Service
|
76
|
+
* Implement Accounts Web Service
|
77
|
+
* Implement Document Matching Web Service
|
78
|
+
|
79
|
+
## Note on Patches/Pull Requests
|
80
|
+
|
81
|
+
* Fork the project.
|
82
|
+
* Make your feature addition or bug fix.
|
83
|
+
* Add tests for it. This is important so I don't break it in a
|
84
|
+
future version unintentionally.
|
85
|
+
* Commit, do not mess with rakefile, version, or history.
|
86
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
87
|
+
* Send me a pull request. Bonus points for topic branches.
|
88
|
+
|
89
|
+
## Copyright
|
90
|
+
|
91
|
+
Copyright (c) 2010 Michael Guterl. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "career_builder"
|
8
|
+
gem.summary = %Q{Ruby wrapper for the CareerBuilder V2 API}
|
9
|
+
gem.description = %Q{Ruby wrapper for the CareerBuilder V2 HTTP XML API}
|
10
|
+
gem.email = "mguterl@gmail.com"
|
11
|
+
gem.homepage = "http://github.com/mguterl/career_builder"
|
12
|
+
gem.authors = ["Michael Guterl"]
|
13
|
+
gem.add_development_dependency "rspec", ">= 1.3.0"
|
14
|
+
gem.add_development_dependency "webmock"
|
15
|
+
gem.add_dependency "nokogiri-happymapper"
|
16
|
+
gem.add_dependency "activesupport", "~> 2.3.5"
|
17
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
18
|
+
end
|
19
|
+
Jeweler::GemcutterTasks.new
|
20
|
+
rescue LoadError
|
21
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
22
|
+
end
|
23
|
+
|
24
|
+
require 'spec/rake/spectask'
|
25
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
26
|
+
spec.libs << 'lib' << 'spec'
|
27
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
28
|
+
end
|
29
|
+
|
30
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
31
|
+
spec.libs << 'lib' << 'spec'
|
32
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
33
|
+
spec.rcov = true
|
34
|
+
end
|
35
|
+
|
36
|
+
task :spec => :check_dependencies
|
37
|
+
|
38
|
+
task :default => :spec
|
39
|
+
|
40
|
+
require 'rake/rdoctask'
|
41
|
+
Rake::RDocTask.new do |rdoc|
|
42
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
43
|
+
|
44
|
+
rdoc.rdoc_dir = 'rdoc'
|
45
|
+
rdoc.title = "career_builder #{version}"
|
46
|
+
rdoc.rdoc_files.include('README*')
|
47
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
48
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,95 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{career_builder}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Michael Guterl"]
|
12
|
+
s.date = %q{2010-06-28}
|
13
|
+
s.description = %q{Ruby wrapper for the CareerBuilder V2 HTTP XML API}
|
14
|
+
s.email = %q{mguterl@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.md"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"Gemfile",
|
23
|
+
"LICENSE",
|
24
|
+
"README.md",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"career_builder.gemspec",
|
28
|
+
"lib/career_builder.rb",
|
29
|
+
"lib/career_builder/api/company.rb",
|
30
|
+
"lib/career_builder/api/interest.rb",
|
31
|
+
"lib/career_builder/api/job_type.rb",
|
32
|
+
"lib/career_builder/api/language.rb",
|
33
|
+
"lib/career_builder/api/location.rb",
|
34
|
+
"lib/career_builder/api/pay.rb",
|
35
|
+
"lib/career_builder/api/resume.rb",
|
36
|
+
"lib/career_builder/api/resume_search.rb",
|
37
|
+
"lib/career_builder/api/resume_search_result.rb",
|
38
|
+
"lib/career_builder/api/school.rb",
|
39
|
+
"lib/career_builder/api/shift_preference.rb",
|
40
|
+
"lib/career_builder/api/word_document.rb",
|
41
|
+
"lib/career_builder/client.rb",
|
42
|
+
"lib/career_builder/errors.rb",
|
43
|
+
"lib/career_builder/request.rb",
|
44
|
+
"lib/career_builder/request/authenticated.rb",
|
45
|
+
"lib/career_builder/requests/advanced_resume_search.rb",
|
46
|
+
"lib/career_builder/requests/authentication.rb",
|
47
|
+
"lib/career_builder/requests/get_resume.rb",
|
48
|
+
"lib/career_builder/requests/resume_actions_remaining_today.rb",
|
49
|
+
"lib/career_builder/resume.rb",
|
50
|
+
"lib/career_builder/resume/lazy_collection.rb",
|
51
|
+
"spec/career_builder/client_spec.rb",
|
52
|
+
"spec/career_builder/resume/lazy_collection_spec.rb",
|
53
|
+
"spec/career_builder/resume_spec.rb",
|
54
|
+
"spec/career_builder_spec.rb",
|
55
|
+
"spec/spec.opts",
|
56
|
+
"spec/spec_helper.rb",
|
57
|
+
"spec/support/webmock.rb"
|
58
|
+
]
|
59
|
+
s.homepage = %q{http://github.com/mguterl/career_builder}
|
60
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
61
|
+
s.require_paths = ["lib"]
|
62
|
+
s.rubygems_version = %q{1.3.7}
|
63
|
+
s.summary = %q{Ruby wrapper for the CareerBuilder V2 API}
|
64
|
+
s.test_files = [
|
65
|
+
"spec/career_builder/client_spec.rb",
|
66
|
+
"spec/career_builder/resume/lazy_collection_spec.rb",
|
67
|
+
"spec/career_builder/resume_spec.rb",
|
68
|
+
"spec/career_builder_spec.rb",
|
69
|
+
"spec/spec_helper.rb",
|
70
|
+
"spec/support/webmock.rb"
|
71
|
+
]
|
72
|
+
|
73
|
+
if s.respond_to? :specification_version then
|
74
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
75
|
+
s.specification_version = 3
|
76
|
+
|
77
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
78
|
+
s.add_development_dependency(%q<rspec>, [">= 1.3.0"])
|
79
|
+
s.add_development_dependency(%q<webmock>, [">= 0"])
|
80
|
+
s.add_runtime_dependency(%q<nokogiri-happymapper>, [">= 0"])
|
81
|
+
s.add_runtime_dependency(%q<activesupport>, ["~> 2.3.5"])
|
82
|
+
else
|
83
|
+
s.add_dependency(%q<rspec>, [">= 1.3.0"])
|
84
|
+
s.add_dependency(%q<webmock>, [">= 0"])
|
85
|
+
s.add_dependency(%q<nokogiri-happymapper>, [">= 0"])
|
86
|
+
s.add_dependency(%q<activesupport>, ["~> 2.3.5"])
|
87
|
+
end
|
88
|
+
else
|
89
|
+
s.add_dependency(%q<rspec>, [">= 1.3.0"])
|
90
|
+
s.add_dependency(%q<webmock>, [">= 0"])
|
91
|
+
s.add_dependency(%q<nokogiri-happymapper>, [">= 0"])
|
92
|
+
s.add_dependency(%q<activesupport>, ["~> 2.3.5"])
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "bundler"
|
3
|
+
Bundler.setup
|
4
|
+
|
5
|
+
require 'net/http'
|
6
|
+
require 'nokogiri'
|
7
|
+
require 'happymapper'
|
8
|
+
require 'active_support/inflector'
|
9
|
+
|
10
|
+
if RUBY_VERSION < '1.9'
|
11
|
+
class BasicObject
|
12
|
+
instance_methods.each do |m|
|
13
|
+
undef_method(m) if m.to_s !~ /(?:^__|^nil\?$|^send$|^object_id$)/
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
require 'career_builder/errors'
|
19
|
+
require 'career_builder/api/resume_search_result'
|
20
|
+
require 'career_builder/api/resume_search'
|
21
|
+
require 'career_builder/api/company'
|
22
|
+
require 'career_builder/api/interest'
|
23
|
+
require 'career_builder/api/job_type'
|
24
|
+
require 'career_builder/api/language'
|
25
|
+
require 'career_builder/api/location'
|
26
|
+
require 'career_builder/api/pay'
|
27
|
+
require 'career_builder/api/school'
|
28
|
+
require 'career_builder/api/shift_preference'
|
29
|
+
require 'career_builder/api/word_document'
|
30
|
+
require 'career_builder/api/resume'
|
31
|
+
require 'career_builder/resume'
|
32
|
+
require 'career_builder/resume/lazy_collection'
|
33
|
+
require 'career_builder/request'
|
34
|
+
require 'career_builder/request/authenticated'
|
35
|
+
require 'career_builder/requests/authentication'
|
36
|
+
require 'career_builder/requests/advanced_resume_search'
|
37
|
+
require 'career_builder/requests/get_resume'
|
38
|
+
require 'career_builder/requests/resume_actions_remaining_today'
|
39
|
+
require 'career_builder/client'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module CareerBuilder
|
2
|
+
|
3
|
+
module API
|
4
|
+
|
5
|
+
class Company
|
6
|
+
|
7
|
+
include HappyMapper
|
8
|
+
|
9
|
+
element :name, String, :tag => "CompanyName"
|
10
|
+
element :job_title, String, :tag => "JobTitle"
|
11
|
+
element :tenure, String, :tag => "Tenure"
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module CareerBuilder
|
2
|
+
|
3
|
+
module API
|
4
|
+
|
5
|
+
class Location
|
6
|
+
|
7
|
+
include HappyMapper
|
8
|
+
|
9
|
+
element :city, String, :tag => "City"
|
10
|
+
element :state, String, :tag => "State"
|
11
|
+
element :zip_code, String, :tag => "ZipCode"
|
12
|
+
element :country, String, :tag => "Country"
|
13
|
+
element :work_status, String, :tag => "WorkStatus"
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|