cb-api 16.3.0 → 17.0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/README.md +131 -36
- data/lib/cb/config.rb +0 -1
- data/lib/cb/convenience.rb +0 -4
- data/lib/cb/version.rb +1 -1
- metadata +2 -6
- data/lib/cb/clients/spot.rb +0 -27
- data/lib/cb/criteria/spot/retrieve.rb +0 -12
- data/lib/cb/models/implementations/spot.rb +0 -30
- data/lib/cb/responses/spot/retrieve_response.rb +0 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7116daa56671ff7d7bd59cdc9346452c5e915c6f
|
4
|
+
data.tar.gz: 09095c9812dea645376cb72a86235f41c8049a71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6639fc9cb077b43eca8755cf6f27a77b4d15fa65916b6af589921c90abc7e41405c4e8ce9ac512668adc15318608ef77b38335cd73266b5ab3258b2dc3ca271
|
7
|
+
data.tar.gz: d1111f7532ce9ae50609df07f3b046c559916604504457339d204628950789f2bfa58a2efc690186cefc38af6a5dd482e885fe1c1cb85638b0b773646e477733
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,7 @@ Version History
|
|
3
3
|
* All Version bumps are required to update this file as well!!
|
4
4
|
----
|
5
5
|
|
6
|
+
* 17.0.0 removed spot cms dependency
|
6
7
|
* 16.3.0 changed api error response to use join instead of to_s
|
7
8
|
* 16.2.2 change degree code to be degree which fixes compatibilty problems
|
8
9
|
* 16.2.1 fix major or program in resume put. it was looking for the wrong value
|
data/README.md
CHANGED
@@ -32,58 +32,153 @@ https://github.com/cbdr/ruby-cb-api/blob/master/lib/cb/config.rb
|
|
32
32
|
|
33
33
|
Job Search
|
34
34
|
================
|
35
|
-
There's a couple ways to go about conducting a job search.
|
36
35
|
|
37
|
-
|
36
|
+
Use the `Cb` convenience methods to access the job client (`Cb::Clients::Job`)
|
38
37
|
|
39
|
-
|
38
|
+
job_client = Cb.job
|
40
39
|
|
41
|
-
|
40
|
+
Using the job client you can search through the listings
|
42
41
|
|
43
|
-
|
44
|
-
crit.location = 'Atlanta, GA'
|
45
|
-
crit.radius = 10
|
46
|
-
search = crit.search()
|
42
|
+
job_client.search({ location: 'Atlanta' })
|
47
43
|
|
48
|
-
|
44
|
+
Or you can search for one job via it's details
|
49
45
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
46
|
+
job_client.find_by_criteria({ })
|
47
|
+
|
48
|
+
Or you can search for one job via it's `did`
|
49
|
+
|
50
|
+
job_client.find_by_did('J3H4CK6XNXYQ07RHSYL')
|
51
|
+
|
52
|
+
When using the job client to do a search you will receive back a search response instance (`Response::Job::Search`)
|
53
|
+
|
54
|
+
search_response = job_client.search({ location: 'Atlanta' })
|
55
|
+
|
56
|
+
Which can be used to retrieve an search result model instance (`Cb::Models::JobResults`)
|
57
|
+
|
58
|
+
search_result_model = search_response.model
|
59
|
+
|
60
|
+
Which encapsulates details of the search result
|
61
|
+
|
62
|
+
search_result.total_count
|
63
|
+
search_result.last_item_index
|
64
|
+
search_result.city
|
65
|
+
search_result.state
|
66
|
+
search_result.postal_code
|
67
|
+
search_result.search_location
|
68
|
+
|
69
|
+
As well as returning back the jobs from the search result (`Cb::Models::Job` instances)
|
70
|
+
|
71
|
+
jobs = search_result.jobs
|
72
|
+
|
73
|
+
Each returned job object contains details of one job listing
|
74
|
+
|
75
|
+
jobs.each do |job|
|
76
|
+
puts "#{job.did}: #{job.company_name} - #{job.title}"
|
54
77
|
end
|
55
78
|
|
56
|
-
|
79
|
+
The search response can also return you any errors which occured during the job search (`Cb::Responses::Errors`). The parsed errors will contain an `Array` of error messages. If it is not empty an error occurred during the request.
|
57
80
|
|
58
|
-
|
59
|
-
puts search.cb_response.total_count
|
60
|
-
puts search.cb_response.errors # Hopefully this is nil! If it's not nil, it will be an array of error messages.
|
81
|
+
search_response.errors.parsed
|
61
82
|
|
62
|
-
|
63
|
-
|
64
|
-
The way that requests are handled is being completely redone. You will now only need to instantiate a single client class and pass it a request object.
|
83
|
+
Job Search params
|
84
|
+
=================
|
65
85
|
|
66
|
-
|
86
|
+
When performing a job search you can provide a `Hash` of search parameters. For example
|
67
87
|
|
68
|
-
|
88
|
+
search_params = { location: 'Atlanta', keywords: 'Database Admin' }
|
89
|
+
Cb.job.search(search_params)
|
69
90
|
|
70
|
-
|
91
|
+
The search params hash can include the following keys:
|
71
92
|
|
72
|
-
|
93
|
+
* keywords
|
94
|
+
* location
|
95
|
+
* postedwithin
|
96
|
+
* excludeapplyrequirments
|
97
|
+
* orderdirection
|
98
|
+
* orderby
|
99
|
+
* pagenumber
|
100
|
+
* hostsite
|
101
|
+
* siteentity
|
102
|
+
* countrycode
|
73
103
|
|
74
|
-
|
104
|
+
Job details
|
105
|
+
===========
|
75
106
|
|
76
|
-
|
77
|
-
response = client.execute request
|
107
|
+
`Cb::Models::Job` has many accessor methods which are used to get the details of the job
|
78
108
|
|
79
|
-
|
109
|
+
If you have preformed a job search, such as
|
80
110
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
* Category
|
85
|
-
* Education
|
86
|
-
* Company
|
87
|
-
* User
|
111
|
+
Cb.job.search({ location: 'Atlanta' }).results.model.jobs.each do |job|
|
112
|
+
puts "Job Details: #{job.company_name} - #{job.title}"
|
113
|
+
end
|
88
114
|
|
89
|
-
|
115
|
+
The following data is available from a job
|
116
|
+
|
117
|
+
* `did`
|
118
|
+
* `title`
|
119
|
+
* `job_skin`
|
120
|
+
* `job_skin_did`
|
121
|
+
* `job_branding`
|
122
|
+
* `pay`
|
123
|
+
* `pay_per`
|
124
|
+
* `commission`
|
125
|
+
* `bonus`
|
126
|
+
* `pay_other`
|
127
|
+
* `categories`
|
128
|
+
* `category_codes`
|
129
|
+
* `degree_required`
|
130
|
+
* `experience_required`
|
131
|
+
* `travel_required`
|
132
|
+
* `industry_codes`
|
133
|
+
* `manages_others_code`
|
134
|
+
* `contact_email_url`
|
135
|
+
* `contact_fax`
|
136
|
+
* `contact_name`
|
137
|
+
* `contact_phone`
|
138
|
+
* `company_name`
|
139
|
+
* `company_did`
|
140
|
+
* `company_details_url`
|
141
|
+
* `company_image_url`
|
142
|
+
* `company`
|
143
|
+
* `description_teaser`
|
144
|
+
* `external_apply_url`
|
145
|
+
* `job_tracking_url`
|
146
|
+
* `location`
|
147
|
+
* `distance`
|
148
|
+
* `latitude`
|
149
|
+
* `longitude`
|
150
|
+
* `location_formatted`
|
151
|
+
* `description`
|
152
|
+
* `requirements`
|
153
|
+
* `employment_type`
|
154
|
+
* `details_url`
|
155
|
+
* `service_url`
|
156
|
+
* `similar_jobs_url`
|
157
|
+
* `apply_url`
|
158
|
+
* `begin_date`
|
159
|
+
* `end_date`
|
160
|
+
* `posted_date`
|
161
|
+
* `relevancy`
|
162
|
+
* `state`
|
163
|
+
* `city`
|
164
|
+
* `zip`
|
165
|
+
* `can_be_quick_applied`
|
166
|
+
* `apply_requirements`
|
167
|
+
* `divison`
|
168
|
+
* `industry`
|
169
|
+
* `location_street_1`
|
170
|
+
* `relocation_options`
|
171
|
+
* `location_street_2`
|
172
|
+
* `display_job_id`
|
173
|
+
* `manages_others_string`
|
174
|
+
* `degree_required_code`
|
175
|
+
* `travel_required_code`
|
176
|
+
* `employment_type_code`
|
177
|
+
* `external_application?`
|
178
|
+
* `relocation_covered?`
|
179
|
+
* `manages_others?`
|
180
|
+
* `screener_apply?`
|
181
|
+
* `shared_job?`
|
182
|
+
* `can_be_quick_applied?`
|
183
|
+
* `has_questionnaire?`
|
184
|
+
* `find_company`
|
data/lib/cb/config.rb
CHANGED
@@ -80,7 +80,6 @@ module Cb
|
|
80
80
|
@uri_subscription_retrieve ||= '/v2/user/subscription/retrieve'
|
81
81
|
@uri_subscription_modify ||= '/v2/user/subscription'
|
82
82
|
@uri_saved_job_search_create ||= '/v2/savedsearch/create'
|
83
|
-
@uri_spot_retrieve ||= '/v2/spot/load'
|
84
83
|
@uri_work_status_list ||= '/v1/resume/workstatuslist'
|
85
84
|
@uri_resume_get ||= '/cbapi/resumes/:resume_hash'
|
86
85
|
@uri_resume_put ||= '/cbapi/resumes/:resume_hash'
|
data/lib/cb/convenience.rb
CHANGED
data/lib/cb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cb-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 17.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The CareerBuilder.com Niche and Consumer Development teams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -206,7 +206,6 @@ files:
|
|
206
206
|
- lib/cb/clients/job_branding.rb
|
207
207
|
- lib/cb/clients/recommendation.rb
|
208
208
|
- lib/cb/clients/saved_search.rb
|
209
|
-
- lib/cb/clients/spot.rb
|
210
209
|
- lib/cb/clients/talent_network.rb
|
211
210
|
- lib/cb/clients/user.rb
|
212
211
|
- lib/cb/config.rb
|
@@ -219,7 +218,6 @@ files:
|
|
219
218
|
- lib/cb/criteria/application/update.rb
|
220
219
|
- lib/cb/criteria/job/details.rb
|
221
220
|
- lib/cb/criteria/resumes/get_by_hash.rb
|
222
|
-
- lib/cb/criteria/spot/retrieve.rb
|
223
221
|
- lib/cb/criteria/user/change_password.rb
|
224
222
|
- lib/cb/criteria/user/delete.rb
|
225
223
|
- lib/cb/exceptions.rb
|
@@ -269,7 +267,6 @@ files:
|
|
269
267
|
- lib/cb/models/implementations/resumes/skills_and_qualifications.rb
|
270
268
|
- lib/cb/models/implementations/resumes/work_experience.rb
|
271
269
|
- lib/cb/models/implementations/saved_search.rb
|
272
|
-
- lib/cb/models/implementations/spot.rb
|
273
270
|
- lib/cb/models/implementations/state.rb
|
274
271
|
- lib/cb/models/implementations/talent_network.rb
|
275
272
|
- lib/cb/models/implementations/user.rb
|
@@ -335,7 +332,6 @@ files:
|
|
335
332
|
- lib/cb/responses/saved_search/retrieve.rb
|
336
333
|
- lib/cb/responses/saved_search/singular.rb
|
337
334
|
- lib/cb/responses/saved_search/update.rb
|
338
|
-
- lib/cb/responses/spot/retrieve_response.rb
|
339
335
|
- lib/cb/responses/timing.rb
|
340
336
|
- lib/cb/responses/user/change_password.rb
|
341
337
|
- lib/cb/responses/user/check_existing.rb
|
data/lib/cb/clients/spot.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'json'
|
2
|
-
|
3
|
-
module Cb
|
4
|
-
module Clients
|
5
|
-
class Spot
|
6
|
-
class << self
|
7
|
-
|
8
|
-
def retrieve(criteria)
|
9
|
-
response = retrieve_api_response criteria
|
10
|
-
Cb::Responses::Spot::Retrieve.new(response)
|
11
|
-
end
|
12
|
-
|
13
|
-
private
|
14
|
-
|
15
|
-
def retrieve_api_response(criteria)
|
16
|
-
params = api_client.class.criteria_to_hash criteria
|
17
|
-
api_client.cb_get(Cb.configuration.uri_spot_retrieve, :query => params)
|
18
|
-
end
|
19
|
-
|
20
|
-
def api_client
|
21
|
-
@api ||= Cb::Utils::Api.instance
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
module Cb
|
2
|
-
module Criteria
|
3
|
-
module Spot
|
4
|
-
class Retrieve
|
5
|
-
extend Cb::Utils::FluidAttributes
|
6
|
-
|
7
|
-
fluid_attr_accessor :contenttype, :language, :sortfield, :sortdirection, :maxitems
|
8
|
-
(1..8).each { |num| fluid_attr_accessor "field#{num.to_s}".to_sym }
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
module Cb
|
2
|
-
module Models
|
3
|
-
class Spot < ApiResponseModel
|
4
|
-
|
5
|
-
attr_accessor :content_type, :start_date, :end_date, :sequence, :language, :experiment_weight_custom_column,
|
6
|
-
:field_1, :field_2, :field_3, :field_4, :field_5, :field_6, :field_7, :field_8,
|
7
|
-
:text_1, :text_2, :text_3, :text_4
|
8
|
-
|
9
|
-
protected
|
10
|
-
|
11
|
-
def required_fields
|
12
|
-
%w(ContentType StartDate EndDate Sequence Language)
|
13
|
-
end
|
14
|
-
|
15
|
-
def set_model_properties
|
16
|
-
@content_type = api_response['ContentType'] || String.new
|
17
|
-
@start_date = api_response['StartDate'] || String.new
|
18
|
-
@end_date = api_response['EndDate'] || String.new
|
19
|
-
@sequence = api_response['Sequence'] || String.new
|
20
|
-
@language = api_response['Language'] || String.new
|
21
|
-
@experiment_weight_custom_value = api_response['ExperimentWeightCustomValue'] || String.new
|
22
|
-
|
23
|
-
# meta programming the @field_# and @text_# variables => ruby swag
|
24
|
-
(1..8).each { |num| instance_variable_set("@field_#{num.to_s}", api_response["Field#{num.to_s}"] || String.new) }
|
25
|
-
(1..4).each { |num| instance_variable_set("@text_#{num.to_s}", api_response["Text#{num.to_s}"] || String.new) }
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
module Cb
|
2
|
-
module Responses
|
3
|
-
module Spot
|
4
|
-
|
5
|
-
class Retrieve < Responses::ApiResponse
|
6
|
-
|
7
|
-
protected
|
8
|
-
|
9
|
-
def validate_api_hash
|
10
|
-
required_response_field(root_node, response)
|
11
|
-
required_response_field(spot_collection, response[root_node])
|
12
|
-
end
|
13
|
-
|
14
|
-
def extract_models
|
15
|
-
if spot_hashes.kind_of?(Array)
|
16
|
-
spot_hashes.map { |spot_data| Cb::Models::Spot.new(spot_data) }
|
17
|
-
else
|
18
|
-
Cb::Models::Spot.new(spot_hashes)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def hash_containing_metadata
|
23
|
-
response[root_node]
|
24
|
-
end
|
25
|
-
|
26
|
-
private
|
27
|
-
|
28
|
-
def root_node
|
29
|
-
@root_node ||= 'ResponseRetrieve'
|
30
|
-
end
|
31
|
-
|
32
|
-
def spot_collection
|
33
|
-
@spot_collection ||= 'SpotData'
|
34
|
-
end
|
35
|
-
|
36
|
-
def spot_hashes
|
37
|
-
response[root_node][spot_collection]
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|