cb-api 5.3.2 → 5.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cb/clients/user.rb +32 -30
- data/lib/cb/models/implementations/saved_search.rb +78 -79
- data/lib/cb/version.rb +1 -1
- metadata +2 -18
data/lib/cb/clients/user.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'json'
|
2
|
-
require 'xmlsimple'
|
3
2
|
|
4
3
|
module Cb
|
5
4
|
module Clients
|
@@ -58,44 +57,47 @@ module Cb
|
|
58
57
|
private
|
59
58
|
|
60
59
|
def build_check_existing_request(email, password)
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
60
|
+
<<-eos
|
61
|
+
<Request>
|
62
|
+
<DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
|
63
|
+
<Email>#{email}</Email>
|
64
|
+
<Password>#{password}</Password>
|
65
|
+
<Test>false</Test>
|
66
|
+
</Request>
|
67
|
+
eos
|
68
68
|
end
|
69
69
|
|
70
70
|
def build_retrieve_request external_id, test_mode
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
71
|
+
<<-eos
|
72
|
+
<Request>
|
73
|
+
<DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
|
74
|
+
<ExternalID>#{external_id}</ExternalID>
|
75
|
+
<Test>#{test_mode.to_s}</Test>
|
76
|
+
</Request>
|
77
|
+
eos
|
78
78
|
end
|
79
79
|
|
80
80
|
def build_change_password_request external_id, old_password, new_password, test_mode
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
81
|
+
<<-eos
|
82
|
+
<Request>
|
83
|
+
<DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
|
84
|
+
<ExternalID>#{external_id}</ExternalID>
|
85
|
+
<Test>#{test_mode.to_s}</Test>
|
86
|
+
<OldPassword>#{old_password}</OldPassword>
|
87
|
+
<NewPassword>#{new_password}</NewPassword>
|
88
|
+
</Request>
|
89
|
+
eos
|
89
90
|
end
|
90
91
|
|
91
92
|
def build_delete_request external_id, password, test_mode
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
93
|
+
<<-eos
|
94
|
+
<Request>
|
95
|
+
<DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
|
96
|
+
<ExternalID>#{external_id}</ExternalID>
|
97
|
+
<Test>#{test_mode.to_s}</Test>
|
98
|
+
<Password>#{password}</Password>
|
99
|
+
</Request>
|
100
|
+
eos
|
99
101
|
end
|
100
102
|
|
101
103
|
def api_client
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'xmlsimple'
|
2
|
-
|
3
1
|
module Cb
|
4
2
|
module Models
|
5
3
|
class SavedSearch
|
@@ -26,68 +24,70 @@ module Cb
|
|
26
24
|
end
|
27
25
|
|
28
26
|
def create_to_xml
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
27
|
+
<<-eos
|
28
|
+
<Request>
|
29
|
+
<HostSite>#{host_site}</HostSite>
|
30
|
+
<Cobrand>#{cobrand}</Cobrand>
|
31
|
+
<SearchName>#{search_name}</SearchName>
|
32
|
+
#{search_parameters.to_xml}
|
33
|
+
<IsDailyEmail>#{is_daily_email.to_s.upcase}</IsDailyEmail>
|
34
|
+
<ExternalUserID>#{external_user_id}</ExternalUserID>
|
35
|
+
<DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
|
36
|
+
</Request>
|
37
|
+
eos
|
38
38
|
end
|
39
39
|
|
40
40
|
def create_anon_to_xml
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
41
|
+
<<-eos
|
42
|
+
<Request>
|
43
|
+
<HostSite>#{host_site}</HostSite>
|
44
|
+
<Cobrand>#{cobrand}</Cobrand>
|
45
|
+
<BrowserID>#{browser_id}</BrowserID>
|
46
|
+
<SessionID>#{session_id}</SessionID>
|
47
|
+
<Test>false</Test>
|
48
|
+
<EmailAddress>#{email_address}</EmailAddress>
|
49
|
+
<SearchName>#{search_name}</SearchName>
|
50
|
+
#{search_parameters.to_xml}
|
51
|
+
<IsDailyEmail>#{is_daily_email.to_s.upcase}</IsDailyEmail>
|
52
|
+
<DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
|
53
|
+
</Request>
|
54
|
+
eos
|
53
55
|
end
|
54
56
|
|
55
57
|
def update_to_xml
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
58
|
+
<<-eos
|
59
|
+
<Request>
|
60
|
+
<HostSite>#{host_site}</HostSite>
|
61
|
+
<Cobrand>#{cobrand}</Cobrand>
|
62
|
+
<SearchName>#{search_name}</SearchName>
|
63
|
+
#{search_parameters.to_xml}
|
64
|
+
<IsDailyEmail>#{is_daily_email.to_s.upcase}</IsDailyEmail>
|
65
|
+
<ExternalID>#{external_id}</ExternalID>
|
66
|
+
<ExternalUserID>#{external_user_id}</ExternalUserID>
|
67
|
+
<DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
|
68
|
+
</Request>
|
69
|
+
eos
|
66
70
|
end
|
67
71
|
|
68
72
|
def delete_to_xml
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
XmlSimple.xml_out request
|
73
|
+
<<-eos
|
74
|
+
<Request>
|
75
|
+
<HostSite>#{host_site}</HostSite>
|
76
|
+
<ExternalID>#{external_id}</ExternalID>
|
77
|
+
<ExternalUserID>#{external_user_id}</ExternalUserID>
|
78
|
+
<DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
|
79
|
+
</Request>
|
80
|
+
eos
|
78
81
|
end
|
79
82
|
|
80
|
-
|
81
|
-
|
82
83
|
def delete_anon_to_xml
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
XmlSimple.xml_out request
|
84
|
+
<<-eos
|
85
|
+
<Request>
|
86
|
+
<ExternalID>#{external_id}</ExternalID>
|
87
|
+
<DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
|
88
|
+
<Test>false</Test>
|
89
|
+
</Request>
|
90
|
+
eos
|
91
91
|
end
|
92
92
|
|
93
93
|
class Delete
|
@@ -129,33 +129,32 @@ module Cb
|
|
129
129
|
@pay_info_only = args['PayInfoOnly'].nil? ? false : args['PayInfoOnly']
|
130
130
|
end
|
131
131
|
|
132
|
-
def to_xml
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
XmlSimple.xml_out([request], 'SuppressEmpty' => nil)
|
132
|
+
def to_xml
|
133
|
+
<<-eos
|
134
|
+
<SearchParameters>
|
135
|
+
<BooleanOperator>#{boolean_operator}</BooleanOperator>
|
136
|
+
<JobCategory>#{category}</JobCategory>
|
137
|
+
<EducationCode>#{education_code}</EducationCode>
|
138
|
+
<EmpType>#{emp_type}</EmpType>
|
139
|
+
<ExcludeCompanyNames>#{exclude_company_names}</ExcludeCompanyNames>
|
140
|
+
<ExcludeJobTitles>#{exclude_job_titles}</ExcludeJobTitles>
|
141
|
+
<ExcludeKeywords>#{exclude_keywords}</ExcludeKeywords>
|
142
|
+
<Country>#{country}</Country>
|
143
|
+
<IndustryCodes>#{industry_codes}</IndustryCodes>
|
144
|
+
<JobTitle>#{job_title}</JobTitle>
|
145
|
+
<Keywords>#{keywords}</Keywords>
|
146
|
+
<Location>#{location}</Location>
|
147
|
+
<OrderBy>#{order_by}</OrderBy>
|
148
|
+
<OrderDirection>#{order_direction}</OrderDirection>
|
149
|
+
<PayHigh>#{pay_high}</PayHigh>
|
150
|
+
<PayLow>#{pay_low}</PayLow>
|
151
|
+
<PostedWithin>#{posted_within}</PostedWithin>
|
152
|
+
<Radius>#{radius}</Radius>
|
153
|
+
<SpecificEducation>#{specific_education}</SpecificEducation>
|
154
|
+
<ExcludeNational>#{exclude_national}</ExcludeNational>
|
155
|
+
<PayInfoOnly>#{pay_info_only}</PayInfoOnly>
|
156
|
+
</SearchParameters>
|
157
|
+
eos
|
159
158
|
end
|
160
159
|
end
|
161
160
|
end
|
data/lib/cb/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cb-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.3.
|
4
|
+
version: 5.3.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: 2014-03-
|
12
|
+
date: 2014-03-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -65,22 +65,6 @@ dependencies:
|
|
65
65
|
- - ~>
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: 2.2.0
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
name: xml-simple
|
70
|
-
requirement: !ruby/object:Gem::Requirement
|
71
|
-
none: false
|
72
|
-
requirements:
|
73
|
-
- - ~>
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 1.1.3
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
none: false
|
80
|
-
requirements:
|
81
|
-
- - ~>
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: 1.1.3
|
84
68
|
- !ruby/object:Gem::Dependency
|
85
69
|
name: rake
|
86
70
|
requirement: !ruby/object:Gem::Requirement
|