README.md in hawatel_search_jobs-0.1.3 vs README.md in hawatel_search_jobs-0.2.0

- old
+ new

@@ -33,29 +33,34 @@ HawatelSearchJobs.configure do |config| config.indeed[:activated] = true config.indeed[:api] = 'api.indeed.com' config.indeed[:version] = '2' config.indeed[:publisher] = 'secret-key' + config.indeed[:page_size] = 25 # allowed range <1,25> config.xing[:activated] = true config.xing[:consumer_key] = 'secret-key' config.xing[:consumer_secret] = 'secret-key' config.xing[:oauth_token] = 'secret-key' config.xing[:oauth_token_secret] = 'secret-key' + config.xing[:page_size] = 25 # allowed range <1,100> config.reed[:activated] = true config.reed[:api] = 'reed.co.uk/api' config.reed[:clientid] = 'secret-key' config.reed[:version] = '1.0' + config.reed[:page_size] = 25 # allowed range <1,100> config.careerbuilder[:activated] = true config.careerbuilder[:api] = 'api.careerbuilder.com' config.careerbuilder[:clientid] = 'secret-key' config.careerbuilder[:version] = 'v2' + config.careerbuilder[:page_size] = 25 # allowed range <1,100> config.careerjet[:activated] = true config.careerjet[:api] = 'public.api.careerjet.net' + config.careerjet[:page_size] = 25 # allowed range <1,99> end ``` #### Where to get a secret-key 1. Indeed: http://www.indeed.com/jsp/apiinfo.jsp @@ -84,11 +89,12 @@ client = HawatelSearchJobs::Client.new client.search_jobs({:keywords => 'ruby'}) p client.jobs_table ``` -Each API has a limit of returned records. For consistency, each API returns maximum `25` records. +Each API has a default limit of returned records. For consistency, each API returns maximum `25` records. +You can change this behavior by setting page_size option in block of HawatelSearchJobs.configure method. #### Get next page of job offers ```ruby client = HawatelSearchJobs::Client.new client.search_jobs({:keywords => 'ruby'}) @@ -97,13 +103,13 @@ #### Get all pages of job offers ```ruby client = HawatelSearchJobs::Client.new client.search_jobs({:keywords => 'ruby'}) - + job_offers = Array.new - + begin job_offers << client.jobs_table end while(client.next) ``` If keywords will be too general probably each API will return loads of data and then a daily limit for an API provider can be exceeded. @@ -122,19 +128,19 @@ Below is an example for indeed but each API has the same result structure. ```ruby client = HawatelSearchJobs::Client.new client.search_jobs({:keywords => 'ruby'}) result = client.jobs_table - + result[:indeed][:code] # HTTP status code (see https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) result[:indeed][:message] # HTTP message (seee https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) - + result[:indeed][:totalResults] # Total results of job offers which matches to your search criteria on API provider result[:indeed][:page] # Current results page number counted from index 0 result[:indeed][:last] # Last results page number result[:indeed][:key] # Internal key which usuely keep last URL sent to API or last used keywords - + result[:indeed][:jobs] # OpenStruct array which store returned job offers from API provider result[:indeed][:jobs].jobtitle # Job title result[:indeed][:jobs].location # Job location result[:indeed][:jobs].company # Company name which posted the job result[:indeed][:jobs].date # Date of the posted job (format %d/%m/%y) @@ -147,6 +153,5 @@ ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). -