Module: HawatelSearchJobs::Api::Careerbuilder
- Extended by:
- Helpers::Base
- Defined in:
- lib/hawatel_search_jobs/api/careerbuilder.rb
Overview
Carerrbuilder API
Constant Summary collapse
- DEFAULT =
{ :keywords => '', :location => '', :company => '' }
- RESULT_LIMIT =
25
Class Method Summary collapse
-
.page(args) ⇒ Hash
Get a specific page result At the beging you have to run Careerbuilder.search method and get :key from result and pass it to the argument :query_key.
-
.search(args) ⇒ Hash
Search jobs by specific criteria.
Class Method Details
.page(args) ⇒ Hash
Get a specific page result At the beging you have to run search method and get :key from result and pass it to the argument :query_key
71 72 73 74 75 76 77 78 |
# File 'lib/hawatel_search_jobs/api/careerbuilder.rb', line 71 def page(args) page = args[:page].to_i || 0 if args[:query_key] url_request = args[:query_key].gsub(/&PageNumber=\d+/, '') << "&PageNumber=#{page+1}" args[:query_key] = url_request search(args) end end |
.search(args) ⇒ Hash
Search jobs by specific criteria
42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/hawatel_search_jobs/api/careerbuilder.rb', line 42 def search(args) args[:query] = DEFAULT.merge(args[:query]) if args[:query] if args[:query_key].nil? url_request = prepare_conn_string(args) + prepare_query(args) else url_request = args[:query_key] end response = send_request(url_request) attributes = build_jobs_table(response, url_request) OpenStruct.new(attributes) end |