careerbuilder / ruby-cb-api

Ruby wrapper around the CareerBuilder.com APIs
Apache License 2.0
14 stars 18 forks source link

Add support for legacy (V2) job search #274

Closed tkling closed 7 years ago

tkling commented 7 years ago

Adds a tiny method to our job search client for performing dev-key powered job searches using /v2/jobsearch.

Here's what usage looks like:

Cb.configure do |config| 
  config.dev_key = 'your-devkey-here'
end

response = Cb::Clients::JobSearch.legacy_get(keywords: 'ruby', location: 'california')
# returns a hash that looks like this: 
{"ResponseJobSearch"=>
  {"Errors"=>nil,
   "TimeResponseSent"=>"5/3/2017 2:12:54 PM",
   "TimeElapsed"=>"0.2343696",
   "TotalPages"=>"6",
   "TotalCount"=>"138",
   # ....
}

# You can work with the individual results like this:
response['ResponseJobSearch']['Results']['JobSearchResult'].size
# => 25
response['ResponseJobSearch']['Results']['JobSearchResult'].first
{ "Company"=>"Blackstone Technology Group, Inc",
 "CompanyDID"=>"chq70977dghnf184l9v",
 "CompanyDetailsURL"=>"http://www.careerbuilder.com/jobs/company/chq70977dghnf184l9v/blackstone-technology-group-inc?sc_cmp1=13_JobRes_ComDet",
 "DID"=>"JGX7YZ75KH2LM11PWNK",
 "OnetCode"=>"15-1099.04",
 "ONetFriendlyTitle"=>"Web Developers",
 "ONet17Code"=>"15-1134.00",
 "ONet17FriendlyTitle"=>"Web Developers",
 "CaroteneV3Code"=>"15.65",
 "CaroteneV3FriendlyTitle"=>"na",
 "DescriptionTeaser"=>
  "Please note: U.S. Citizens and those authorizedto work in the U.S. are encouraged to apply."
  # ...
}
tkling commented 7 years ago

@frankolson @L33tH4x0r check this branch out and let me know if you run into any issues!

ghost commented 7 years ago

Closing this for now. We can update this branch and revisit in the future

tkling commented 7 years ago

:thumbsup: