cb-api 0.1.13 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/lib/cb.rb +1 -0
- data/lib/cb/clients/cb_saved_job_search_api.rb +14 -0
- data/lib/cb/config.rb +4 -2
- data/lib/cb/models/branding/media.rb +2 -1
- data/lib/cb/models/branding/styles/company_info.rb +4 -4
- data/lib/cb/models/branding/styles/job_details.rb +3 -3
- data/lib/cb/models/cb_job.rb +1 -1
- data/lib/cb/models/cb_job_branding.rb +6 -4
- data/lib/cb/models/cb_saved_job_search.rb +79 -0
- data/lib/cb/version.rb +1 -1
- metadata +7 -13
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MDQ4MGFkZDMyYTE0YTAwODFlNWEyNWI0MWRiMDQwY2U1ODE5YmUyMw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
Y2MwZThmYzllYmU0MGNiNzY5MDdlYWMyZGExZTYxNDhhN2FhMzZjMg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
Zjg3YmY3ODg0ZWZiMTVhZWZlYjlmNmE2YzNkZDg3ZTUxMjgwMjJjNmU2NTE5
|
10
|
+
YTBjYTdkN2MyYmVmNzg5M2Q2NDk5MTRlNWM4Y2EyMjcxMzg0NmY1NTBkY2Ux
|
11
|
+
YTJiMmIwNTE4YjE1ZTQ3ZjAzOTgyMmQ1YmYzMjZjMDg2ZmU1YzM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MjVmYTczZGUzOTkxYWY2Yzc4MDA0OTkzYjNlZDZhZWUxZGNhYTJkMzkwNGI2
|
14
|
+
ODc5ZjIyMDE2MDY5MGFjYjEyMTFhMzE0MTJhYTE1M2E0M2ZhOWY3M2ZmYTcw
|
15
|
+
MTc4ZWE5YzlkN2NlODFkZTI2YmRjZWM5MzI1NjNmMDMwNzFjYzM=
|
data/lib/cb.rb
CHANGED
@@ -4,6 +4,7 @@ Dir[File.dirname(__FILE__) + '/cb/clients/*.rb'].each {| file| require file }
|
|
4
4
|
Dir[File.dirname(__FILE__) + '/cb/criteria/*.rb'].each {| file| require file }
|
5
5
|
Dir[File.dirname(__FILE__) + '/cb/models/*.rb'].each {| file| require file }
|
6
6
|
require 'cb/models/branding/styles/base'
|
7
|
+
require 'cb/models/branding/styles/css_adapter'
|
7
8
|
Dir[File.dirname(__FILE__) + '/cb/models/**/*.rb'].each {| file| require file }
|
8
9
|
|
9
10
|
module Cb
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "json"
|
2
|
+
require "nokogiri"
|
3
|
+
|
4
|
+
module Cb
|
5
|
+
class SavedJobSearchApi
|
6
|
+
|
7
|
+
def create_saved_search(search)
|
8
|
+
my_api = Cb::Utils::Api.new()
|
9
|
+
saved_search = my_api.cb_post(Cb.configuration.uri_saved_job_search_create,
|
10
|
+
:body => search.to_xml)
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
data/lib/cb/config.rb
CHANGED
@@ -10,7 +10,7 @@ module Cb
|
|
10
10
|
:uri_application_external,
|
11
11
|
:uri_application_registered, :uri_user_change_password,
|
12
12
|
:uri_user_delete, :uri_user_retrieve,
|
13
|
-
:uri_job_branding
|
13
|
+
:uri_job_branding, :uri_saved_job_search_create
|
14
14
|
|
15
15
|
def initialize
|
16
16
|
Cb::Utils::Country.inject_convenience_methods
|
@@ -35,6 +35,7 @@ module Cb
|
|
35
35
|
@uri_user_delete ||= '/v2/User/delete'
|
36
36
|
@uri_user_retrieve ||= '/v2/user/retrieve'
|
37
37
|
@uri_job_branding ||= '/branding'
|
38
|
+
@uri_saved_job_search_create ||= '/v2/savedsearch/create'
|
38
39
|
end
|
39
40
|
|
40
41
|
def to_hash
|
@@ -57,7 +58,8 @@ module Cb
|
|
57
58
|
:uri_application_registered => @uri_application_registered,
|
58
59
|
:uri_user_change_password => @uri_user_change_password,
|
59
60
|
:uri_user_retrieve => @uri_user_retrieve,
|
60
|
-
:uri_job_branding => @uri_job_branding
|
61
|
+
:uri_job_branding => @uri_job_branding,
|
62
|
+
:uri_saved_job_search_create => @uri_saved_job_search_create
|
61
63
|
}
|
62
64
|
end
|
63
65
|
|
@@ -3,7 +3,7 @@ module Cb
|
|
3
3
|
|
4
4
|
class Media
|
5
5
|
|
6
|
-
attr_accessor :header, :header_type, :tablet_banner, :mobile_logo, :footer
|
6
|
+
attr_accessor :header, :header_type, :tablet_banner, :mobile_logo, :footer, :is_multi_video
|
7
7
|
|
8
8
|
def initialize args = {}
|
9
9
|
@header = args['Header'] || ''
|
@@ -11,6 +11,7 @@ module Cb
|
|
11
11
|
@tablet_banner = args['TabletBanner'] || ''
|
12
12
|
@mobile_logo = args['MobileLogo'] || ''
|
13
13
|
@footer = args['Footer'] || ''
|
14
|
+
@is_multi_video = args['IsMultiVideo'] == 'true'
|
14
15
|
end
|
15
16
|
|
16
17
|
end
|
@@ -8,10 +8,10 @@ module Cb
|
|
8
8
|
def initialize args = {}
|
9
9
|
super
|
10
10
|
|
11
|
-
@buttons = Buttons.new args
|
12
|
-
@container = Container.new args
|
13
|
-
@content = Content.new args
|
14
|
-
@headings = Headings.new args
|
11
|
+
@buttons = Buttons.new args['Buttons']
|
12
|
+
@container = Container.new args['Container']
|
13
|
+
@content = Content.new args['Content']
|
14
|
+
@headings = Headings.new args['Headings']
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -8,9 +8,9 @@ module Cb
|
|
8
8
|
def initialize args = {}
|
9
9
|
super
|
10
10
|
|
11
|
-
@container = Container.new args
|
12
|
-
@content = Content.new args
|
13
|
-
@headings = Headings.new args
|
11
|
+
@container = Container.new args['Container']
|
12
|
+
@content = Content.new args['Content']
|
13
|
+
@headings = Headings.new args['Headings']
|
14
14
|
end
|
15
15
|
|
16
16
|
end
|
data/lib/cb/models/cb_job.rb
CHANGED
@@ -31,7 +31,7 @@ module Cb
|
|
31
31
|
@location_formatted = args['LocationFormatted'] || ''
|
32
32
|
@job_skin = args.has_key?("JobSkin") && !args["JobSkin"].nil? ? args['JobSkin']['#cdata-section'] : ''
|
33
33
|
@job_skin_did = args['JobSkinDID'] || ''
|
34
|
-
@job_branding = @job_skin_did.blank? ? '' : Cb.job_branding.find_by_id(
|
34
|
+
@job_branding = @job_skin_did.blank? ? '' : Cb.job_branding.find_by_id(job_skin_did)
|
35
35
|
|
36
36
|
# Compensation
|
37
37
|
@pay = args['PayHighLowFormatted'] || ''
|
@@ -1,9 +1,7 @@
|
|
1
|
-
require 'cb/models/branding/styles/css_adapter' # Path load errors in cb.rb - just doing this here for the time being.
|
2
|
-
|
3
1
|
module Cb
|
4
2
|
class CbJobBranding
|
5
3
|
|
6
|
-
attr_accessor :name, :media, :sections, :styles, :widgets, :id, :account_id, :type, :errors
|
4
|
+
attr_accessor :name, :media, :sections, :styles, :widgets, :id, :account_id, :type, :errors, :show_widgets
|
7
5
|
|
8
6
|
def initialize args = {}
|
9
7
|
@name = args['Name'] || ''
|
@@ -21,7 +19,11 @@ module Cb
|
|
21
19
|
end
|
22
20
|
|
23
21
|
args['Widgets'].each do |type, url|
|
24
|
-
|
22
|
+
if type == 'ShowWidgets'
|
23
|
+
@show_widgets = url == 'true'
|
24
|
+
else
|
25
|
+
@widgets << Cb::Branding::Widget.new(type, url) unless url.nil?
|
26
|
+
end
|
25
27
|
end
|
26
28
|
end
|
27
29
|
|
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
module Cb
|
3
|
+
class CbSavedJobSearch
|
4
|
+
attr_accessor :hostsite, :cobrand, :site_id, :search_name, :boolean_operator, :category, :education_code, :specific_education,
|
5
|
+
:emp_type, :exclude_company_names, :exclude_job_titles, :exclude_national, :industry_codes,
|
6
|
+
:keywords, :order_by, :order_direction, :radius, :pay_high, :pay_low, :posted_within,
|
7
|
+
:pay_info_only, :location, :job_category, :company, :city, :state, :is_daily_email, :external_user_id,
|
8
|
+
:dev_key
|
9
|
+
|
10
|
+
def initialize(args={})
|
11
|
+
@hostsite = args[:HostSite] || ''
|
12
|
+
@cobrand = args[:Cobrand] || ''
|
13
|
+
@search_name = args[:SearchName] || ''
|
14
|
+
@site_id = args[:SiteId] || ''
|
15
|
+
@boolean_operator = args[:BooleanOperator] || ''
|
16
|
+
@category = args[:Category] || ''
|
17
|
+
@education_code = args[:EducationCode] || ''
|
18
|
+
@specific_education = args[:SpecificEducation] || false
|
19
|
+
@emp_type = args[:EmpType] || ''
|
20
|
+
@exclude_company_names = args[:ExcludeCompanyNames] || ''
|
21
|
+
@exclude_job_titles = args[:ExcludeJobTitles] || ''
|
22
|
+
@exclude_national = args[:ExcludeNational] || false
|
23
|
+
@industry_codes = args[:IndustryCodes] || ''
|
24
|
+
@keywords = args[:Keywords] || ''
|
25
|
+
@order_by = args[:OrderBy] || ''
|
26
|
+
@order_direction = args[:OrderDirection] || ''
|
27
|
+
@radius = args[:Radius] || 30
|
28
|
+
@pay_high = args[:PayHigh] || 0
|
29
|
+
@pay_low = args[:PayLow] || 0
|
30
|
+
@posted_within = args[:PostedWithin] || 30
|
31
|
+
@pay_info_only = args[:PayInfoOnly] || false
|
32
|
+
@location = args[:Location] || ''
|
33
|
+
@job_category = args[:JobCategory] || ''
|
34
|
+
@company = args[:Company] || ''
|
35
|
+
@city = args[:City] || ''
|
36
|
+
@state = args[:State] || ''
|
37
|
+
@is_daily_email = args[:IsDailyEmail] || ''
|
38
|
+
@external_user_id = args[:ExternalUserId] || ''
|
39
|
+
@dev_key = args[:DeveloperKey] || "#{Cb.configuration.dev_key}"
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_xml
|
43
|
+
ret = "<Request>"
|
44
|
+
ret += "<HostSite>#{@hostsite}</HostSite>"
|
45
|
+
ret += "<Cobrand>#{@cobrand}</Cobrand>"
|
46
|
+
ret += "<SearchName>#{@search_name}</SearchName>"
|
47
|
+
ret += "<SearchParameters>"
|
48
|
+
ret += "<BooleanOperator>#{@boolean_operator}</BooleanOperator>"
|
49
|
+
ret += "<Category>#{@category}</Category>"
|
50
|
+
ret += "<EducationCode>#{@education_code}</EducationCode>"
|
51
|
+
ret += "<SpecificEducation>#{@specific_education}</SpecificEducation>"
|
52
|
+
ret += "<EmpType>#{@emp_type}</EmpType>"
|
53
|
+
ret += "<ExcludeCompanyNames>#{@exclude_company_names}</ExcludeCompanyNames>"
|
54
|
+
ret += "<ExcludeJobTitles>#{@exclude_job_titles}</ExcludeJobTitles>"
|
55
|
+
ret += "<ExcludeNational>#{@exclude_national}</ExcludeNational>"
|
56
|
+
ret += "<IndustryCodes>#{@industry_codes}</IndustryCodes>"
|
57
|
+
ret += "<Keywords>#{@keywords}</Keywords>"
|
58
|
+
ret += "<OrderBy>#{@order_by}</OrderBy>"
|
59
|
+
ret += "<OrderDirection>#{@order_direction}</OrderDirection>"
|
60
|
+
ret += "<Radius>#{@radius}</Radius>"
|
61
|
+
ret += "<PayHigh>#{@pay_high}</PayHigh>"
|
62
|
+
ret += "<PayLow>#{@pay_high}</PayLow>"
|
63
|
+
ret += "<PostedWithin>#{@posted_within}</PostedWithin>"
|
64
|
+
ret += "<PayInfoOnly>#{@pay_info_only}</PayInfoOnly>"
|
65
|
+
ret += "<Location>#{@location}</Location>"
|
66
|
+
ret += "<JobCategory>#{@job_category}</JobCategory>"
|
67
|
+
ret += "<Company>#{@company}</Company>"
|
68
|
+
ret += "<City>#{@city}</City>"
|
69
|
+
ret += "<State>#{@state}</State>"
|
70
|
+
ret += "</SearchParameters>"
|
71
|
+
ret += "<IsDailyEmail>#{@is_daily_email}</IsDailyEmail>"
|
72
|
+
ret += "<ExternalUserID>#{@external_user_id}</ExternalUserID>"
|
73
|
+
ret += "<DeveloperKey>#{@dev_key}</DeveloperKey>"
|
74
|
+
ret += "</Request>"
|
75
|
+
|
76
|
+
ret
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
data/lib/cb/version.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cb-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.16
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jesse Retchko
|
@@ -15,12 +14,11 @@ authors:
|
|
15
14
|
autorequire:
|
16
15
|
bindir: bin
|
17
16
|
cert_chain: []
|
18
|
-
date: 2013-07-
|
17
|
+
date: 2013-07-18 00:00:00.000000000 Z
|
19
18
|
dependencies:
|
20
19
|
- !ruby/object:Gem::Dependency
|
21
20
|
name: httparty
|
22
21
|
requirement: !ruby/object:Gem::Requirement
|
23
|
-
none: false
|
24
22
|
requirements:
|
25
23
|
- - ~>
|
26
24
|
- !ruby/object:Gem::Version
|
@@ -28,7 +26,6 @@ dependencies:
|
|
28
26
|
type: :runtime
|
29
27
|
prerelease: false
|
30
28
|
version_requirements: !ruby/object:Gem::Requirement
|
31
|
-
none: false
|
32
29
|
requirements:
|
33
30
|
- - ~>
|
34
31
|
- !ruby/object:Gem::Version
|
@@ -36,7 +33,6 @@ dependencies:
|
|
36
33
|
- !ruby/object:Gem::Dependency
|
37
34
|
name: json
|
38
35
|
requirement: !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
36
|
requirements:
|
41
37
|
- - ~>
|
42
38
|
- !ruby/object:Gem::Version
|
@@ -44,7 +40,6 @@ dependencies:
|
|
44
40
|
type: :runtime
|
45
41
|
prerelease: false
|
46
42
|
version_requirements: !ruby/object:Gem::Requirement
|
47
|
-
none: false
|
48
43
|
requirements:
|
49
44
|
- - ~>
|
50
45
|
- !ruby/object:Gem::Version
|
@@ -52,7 +47,6 @@ dependencies:
|
|
52
47
|
- !ruby/object:Gem::Dependency
|
53
48
|
name: nori
|
54
49
|
requirement: !ruby/object:Gem::Requirement
|
55
|
-
none: false
|
56
50
|
requirements:
|
57
51
|
- - ~>
|
58
52
|
- !ruby/object:Gem::Version
|
@@ -60,7 +54,6 @@ dependencies:
|
|
60
54
|
type: :runtime
|
61
55
|
prerelease: false
|
62
56
|
version_requirements: !ruby/object:Gem::Requirement
|
63
|
-
none: false
|
64
57
|
requirements:
|
65
58
|
- - ~>
|
66
59
|
- !ruby/object:Gem::Version
|
@@ -80,6 +73,7 @@ files:
|
|
80
73
|
- lib/cb/clients/application_api.rb
|
81
74
|
- lib/cb/clients/application_external_api.rb
|
82
75
|
- lib/cb/clients/category_api.rb
|
76
|
+
- lib/cb/clients/cb_saved_job_search_api.rb
|
83
77
|
- lib/cb/clients/company_api.rb
|
84
78
|
- lib/cb/clients/education_api.rb
|
85
79
|
- lib/cb/clients/employee_types_api.rb
|
@@ -112,6 +106,7 @@ files:
|
|
112
106
|
- lib/cb/models/cb_employee_type.rb
|
113
107
|
- lib/cb/models/cb_job.rb
|
114
108
|
- lib/cb/models/cb_job_branding.rb
|
109
|
+
- lib/cb/models/cb_saved_job_search.rb
|
115
110
|
- lib/cb/models/cb_user.rb
|
116
111
|
- lib/cb/utils/api.rb
|
117
112
|
- lib/cb/utils/country.rb
|
@@ -123,26 +118,25 @@ files:
|
|
123
118
|
- README.md
|
124
119
|
homepage: http://api.careerbuilder.com
|
125
120
|
licenses: []
|
121
|
+
metadata: {}
|
126
122
|
post_install_message:
|
127
123
|
rdoc_options: []
|
128
124
|
require_paths:
|
129
125
|
- lib
|
130
126
|
required_ruby_version: !ruby/object:Gem::Requirement
|
131
|
-
none: false
|
132
127
|
requirements:
|
133
128
|
- - ! '>='
|
134
129
|
- !ruby/object:Gem::Version
|
135
130
|
version: '0'
|
136
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
132
|
requirements:
|
139
133
|
- - ! '>='
|
140
134
|
- !ruby/object:Gem::Version
|
141
135
|
version: '0'
|
142
136
|
requirements: []
|
143
137
|
rubyforge_project:
|
144
|
-
rubygems_version:
|
138
|
+
rubygems_version: 2.0.3
|
145
139
|
signing_key:
|
146
|
-
specification_version:
|
140
|
+
specification_version: 4
|
147
141
|
summary: Ruby wrapper around Careerbuilder Public API.
|
148
142
|
test_files: []
|