cb-api 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YTE2NjEzMzI5ZGJmNGNiYmU2NWZkZDNkOGMxMDQ2ZWViNDI2NTk3MA==
5
+ data.tar.gz: !binary |-
6
+ M2U4NzU4ZDBmNzg5YmMzY2M4MmFhODVjZDc5ZDhiOGEyOWY1NDM3MA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZTVjZWMxNjY0MjViZDM5YTk3ODAyZDY3N2UyNDgzMTgxOGQwY2NkMmZlNzc3
10
+ ZDA0OTE5NjUxOWFhNDRiYWQ0YTk2MmU2ODA5YWQwOTlhYjJhNzY1NjVmZjVi
11
+ ZDExZDgwYjkzN2FlZjdkMjg2NDBkYTM3M2U2YmI0N2IyNGZlYjE=
12
+ data.tar.gz: !binary |-
13
+ YjZkNTNkYTcwYjEyMWRjYTk1MTczMzVlMDY0YmNlYjg5Nzk0Y2U3MDcwMTk1
14
+ MWY5YTY2MmU2YjQ3NjgwYTIwZDE1MzIxMjU3ZjNmZTZiYjVjZWU2NGI0NGE3
15
+ ZmE1NWU2NTZiMjc3OWE0YzkwYTFmOTcwNTc5NjEyMmQ1ZDVhMGY=
@@ -110,9 +110,9 @@ module Cb
110
110
  ## For detailed information around this API please visit:
111
111
  ## http://api.careerbuilder.com/savedsearchinfo.aspx
112
112
  #############################################################
113
- def self.list developer_key, external_user_id
113
+ def self.list developer_key, external_user_id, host_site
114
114
  my_api = Cb::Utils::Api.new
115
- json_hash = my_api.cb_get Cb.configuration.uri_saved_search_list, :query => {:developerkey=>developer_key, :ExternalUserId=>external_user_id}
115
+ json_hash = my_api.cb_get Cb.configuration.uri_saved_search_list, :query => {:developerkey=>developer_key, :ExternalUserId=>external_user_id, :hostsite=> host_site}
116
116
  saved_searches = []
117
117
  if json_hash.has_key?('SavedJobSearches') && json_hash['SavedJobSearches'].has_key?('SavedSearches')
118
118
  saved_search_hash = json_hash['SavedJobSearches']['SavedSearches']
@@ -10,7 +10,7 @@ module Cb
10
10
  def initialize(args = {})
11
11
  @job_did = args[:job_did] || ''
12
12
  @email = args[:email] || ''
13
- @site_id = args[:site_id] || ''
13
+ @site_id = args[:site_id] || 'cbnsv'
14
14
  @ipath = args[:ipath] || ''
15
15
  @apply_url = ''
16
16
  end
@@ -5,7 +5,8 @@ module Cb
5
5
  :emp_type, :exclude_company_names, :exclude_job_titles, :exclude_national, :industry_codes,
6
6
  :keywords, :order_by, :order_direction, :radius, :pay_high, :pay_low, :posted_within,
7
7
  :pay_info_only, :location, :job_category, :company, :city, :state, :is_daily_email, :external_id,
8
- :external_user_id, :dev_key, :job_search_url, :jrdid, :errors, :browser_id, :session_id, :test, :email_address
8
+ :external_user_id, :dev_key, :job_search_url, :jrdid, :errors, :browser_id, :session_id, :test, :email_address,
9
+ :saved_search_parameters
9
10
 
10
11
  def initialize(args={})
11
12
  @hostsite = args['HostSite'] || ''
@@ -35,6 +36,7 @@ module Cb
35
36
  @city = args['City'] || ''
36
37
  @state = args['State'] || ''
37
38
  @is_daily_email = args['IsDailyEmail'] || ''
39
+ @email_delivery_day = args['EmailDeliveryDay'] || ''
38
40
  @external_id = args['ExternalID'] || ''
39
41
  @external_user_id = args['ExternalUserID'] || ''
40
42
  @dev_key = args['DeveloperKey'] || ''
@@ -45,13 +47,84 @@ module Cb
45
47
  @session_id = args['SessionID'] || ''
46
48
  @test = args['Test'].to_s || false
47
49
  @email_address = args['EmailAddress'] || ''
50
+ if args.has_key?('SavedSearchParameters')
51
+ unless args['SavedSearchParameters'].empty?
52
+ @saved_search_parameters = CbSavedSearch.new(args['SavedSearchParameters'])
53
+ end
54
+ end
48
55
  end
49
56
 
57
+ class CbSavedSearchParameters
58
+ attr_accessor :boolean_operator, :category, :education_code, :emp_type, :exclude_company_names, :exclude_job_titles,
59
+ :exclude_keywords, :exclude_national, :industry_codes, :job_title, :keywords, :location, :order_by,
60
+ :order_direction, :pay_high, :pay_info_only, :pay_low, :posted_within, :radius, :specific_education
61
+
62
+ def initialize(args = {})
63
+ @boolean_operator = args['BooleanOperator'] || ''
64
+ @category = args['Category'] || ''
65
+ @education_code = args['EducationCode'] || ''
66
+ @emp_type = args['EmpType'] || ''
67
+ @exclude_company_names = args['ExcludeCompanyNames'] || ''
68
+ @exclude_job_titles = args['ExcludeJobTitles'] || ''
69
+ @exclude_keywords = args['ExcludeKeywords'] || ''
70
+ @exclude_national = args['ExcludeNational'] || false
71
+ @industry_codes = args['IndustryCodes'] || ''
72
+ @job_title = args['Jobtitle'] || ''
73
+ @keywords = args['Keywords'] || ''
74
+ @location = args['Location'] || ''
75
+ @order_by = args['OrderBy'] || ''
76
+ @order_direction = args['OrderDirection'] || ''
77
+ @pay_high = args['PayHigh'] || 0
78
+ @pay_info_only = args['PayInfoOnly'] || false
79
+ @pay_low = args['PayLow'] || 0
80
+ @posted_within = args['PostedWithin'] || 30
81
+ @radius = args['Radius'] || 30
82
+ @specific_education = args['SpecificEducation'] || false
83
+ end
84
+ end #CbSavedSearchParameters
85
+
50
86
  def create_to_xml
51
87
  ret = "<Request>"
52
88
  ret += "<HostSite>#{@hostsite}</HostSite>"
53
89
  ret += "<Cobrand>#{@cobrand}</Cobrand>"
54
- unless @browser_id.nil?
90
+ ret += "<SearchName>#{@search_name}</SearchName>"
91
+ ret += "<SearchParameters>"
92
+ ret += "<BooleanOperator>#{@boolean_operator}</BooleanOperator>"
93
+ ret += "<Category>#{@category}</Category>"
94
+ ret += "<EducationCode>#{@education_code}</EducationCode>"
95
+ ret += "<SpecificEducation>#{@specific_education}</SpecificEducation>"
96
+ ret += "<EmpType>#{@emp_type}</EmpType>"
97
+ ret += "<ExcludeCompanyNames>#{@exclude_company_names}</ExcludeCompanyNames>"
98
+ ret += "<ExcludeJobTitles>#{@exclude_job_titles}</ExcludeJobTitles>"
99
+ ret += "<ExcludeNational>#{@exclude_national}</ExcludeNational>"
100
+ ret += "<IndustryCodes>#{@industry_codes}</IndustryCodes>"
101
+ ret += "<Keywords>#{@keywords}</Keywords>"
102
+ ret += "<OrderBy>#{@order_by}</OrderBy>"
103
+ ret += "<OrderDirection>#{@order_direction}</OrderDirection>"
104
+ ret += "<Radius>#{@radius}</Radius>"
105
+ ret += "<PayHigh>#{@pay_high}</PayHigh>"
106
+ ret += "<PayLow>#{@pay_high}</PayLow>"
107
+ ret += "<PostedWithin>#{@posted_within}</PostedWithin>"
108
+ ret += "<PayInfoOnly>#{@pay_info_only}</PayInfoOnly>"
109
+ ret += "<Location>#{@location}</Location>"
110
+ ret += "<JobCategory>#{@job_category}</JobCategory>"
111
+ ret += "<Company>#{@company}</Company>"
112
+ ret += "<City>#{@city}</City>"
113
+ ret += "<State>#{@state}</State>"
114
+ ret += "</SearchParameters>"
115
+ ret += "<IsDailyEmail>#{@is_daily_email.upcase}</IsDailyEmail>"
116
+ ret += "<ExternalUserID>#{@external_user_id}</ExternalUserID>"
117
+ ret += "<DeveloperKey>#{@dev_key}</DeveloperKey>"
118
+ ret += "</Request>"
119
+
120
+ ret
121
+ end
122
+
123
+ def create_anon_to_xml
124
+ ret = "<Request>"
125
+ ret += "<HostSite>#{@hostsite}</HostSite>"
126
+ ret += "<Cobrand>#{@cobrand}</Cobrand>"
127
+ unless @email_address.nil?
55
128
  ret += "<BrowserID>#{@browser_id}</BrowserID>"
56
129
  ret += "<SessionID>#{@session_id}</SessionID>"
57
130
  ret += "<Test>#{@test}</Test>"
@@ -83,7 +156,7 @@ module Cb
83
156
  ret += "<State>#{@state}</State>"
84
157
  ret += "</SearchParameters>"
85
158
  ret += "<IsDailyEmail>#{@is_daily_email.upcase}</IsDailyEmail>"
86
- if @browser_id.nil?
159
+ unless @email_address.nil?
87
160
  ret += "<ExternalUserID>#{@external_user_id}</ExternalUserID>"
88
161
  end
89
162
  ret += "<DeveloperKey>#{@dev_key}</DeveloperKey>"
data/lib/cb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cb
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
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.3.1
5
- prerelease:
4
+ version: 0.3.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jesse Retchko
@@ -19,12 +18,11 @@ authors:
19
18
  autorequire:
20
19
  bindir: bin
21
20
  cert_chain: []
22
- date: 2013-09-05 00:00:00.000000000 Z
21
+ date: 2013-09-25 00:00:00.000000000 Z
23
22
  dependencies:
24
23
  - !ruby/object:Gem::Dependency
25
24
  name: httparty
26
25
  requirement: !ruby/object:Gem::Requirement
27
- none: false
28
26
  requirements:
29
27
  - - ~>
30
28
  - !ruby/object:Gem::Version
@@ -32,7 +30,6 @@ dependencies:
32
30
  type: :runtime
33
31
  prerelease: false
34
32
  version_requirements: !ruby/object:Gem::Requirement
35
- none: false
36
33
  requirements:
37
34
  - - ~>
38
35
  - !ruby/object:Gem::Version
@@ -40,7 +37,6 @@ dependencies:
40
37
  - !ruby/object:Gem::Dependency
41
38
  name: json
42
39
  requirement: !ruby/object:Gem::Requirement
43
- none: false
44
40
  requirements:
45
41
  - - ~>
46
42
  - !ruby/object:Gem::Version
@@ -48,7 +44,6 @@ dependencies:
48
44
  type: :runtime
49
45
  prerelease: false
50
46
  version_requirements: !ruby/object:Gem::Requirement
51
- none: false
52
47
  requirements:
53
48
  - - ~>
54
49
  - !ruby/object:Gem::Version
@@ -56,7 +51,6 @@ dependencies:
56
51
  - !ruby/object:Gem::Dependency
57
52
  name: nori
58
53
  requirement: !ruby/object:Gem::Requirement
59
- none: false
60
54
  requirements:
61
55
  - - ~>
62
56
  - !ruby/object:Gem::Version
@@ -64,7 +58,6 @@ dependencies:
64
58
  type: :runtime
65
59
  prerelease: false
66
60
  version_requirements: !ruby/object:Gem::Requirement
67
- none: false
68
61
  requirements:
69
62
  - - ~>
70
63
  - !ruby/object:Gem::Version
@@ -72,7 +65,6 @@ dependencies:
72
65
  - !ruby/object:Gem::Dependency
73
66
  name: nokogiri
74
67
  requirement: !ruby/object:Gem::Requirement
75
- none: false
76
68
  requirements:
77
69
  - - ~>
78
70
  - !ruby/object:Gem::Version
@@ -80,7 +72,6 @@ dependencies:
80
72
  type: :runtime
81
73
  prerelease: false
82
74
  version_requirements: !ruby/object:Gem::Requirement
83
- none: false
84
75
  requirements:
85
76
  - - ~>
86
77
  - !ruby/object:Gem::Version
@@ -158,26 +149,25 @@ files:
158
149
  - README.md
159
150
  homepage: http://api.careerbuilder.com
160
151
  licenses: []
152
+ metadata: {}
161
153
  post_install_message:
162
154
  rdoc_options: []
163
155
  require_paths:
164
156
  - lib
165
157
  required_ruby_version: !ruby/object:Gem::Requirement
166
- none: false
167
158
  requirements:
168
159
  - - ! '>='
169
160
  - !ruby/object:Gem::Version
170
161
  version: '0'
171
162
  required_rubygems_version: !ruby/object:Gem::Requirement
172
- none: false
173
163
  requirements:
174
164
  - - ! '>='
175
165
  - !ruby/object:Gem::Version
176
166
  version: '0'
177
167
  requirements: []
178
168
  rubyforge_project:
179
- rubygems_version: 1.8.25
169
+ rubygems_version: 2.0.5
180
170
  signing_key:
181
- specification_version: 3
171
+ specification_version: 4
182
172
  summary: Ruby wrapper around Careerbuilder Public API.
183
173
  test_files: []