careerjet-api-client 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -13
- data/README.md +66 -25
- data/careerjet-api-client.gemspec +2 -2
- data/lib/careerjet/constants.rb +2 -2
- data/lib/careerjet/version.rb +1 -1
- metadata +25 -25
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
OThjNmQwZjE3MTVlMzQ4NTM1ZWM2NTkxNTI0MTQxZGE5NmQxOGM4Yw==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 23f766f9a070c345805a33e2084ec3d6dafe6184
|
4
|
+
data.tar.gz: d5a0e88f23da13227303c1e2a6ac8bfa16648be9
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NTc1MzNlZGNmMjYwMTk3NWJkNGMwMzliOTNkOGJkNTU0OTFiYWY3NTkxNGM4
|
11
|
-
YTgyNDg2YjU2Nzc0MWUwMjI5MzE1YWJjYzc4YjJkZjMxZTVlNjg=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MWEwZTY3YzM2MjI3NjNkNjhiZTFlNDNlMDI1ZTUzMWUzMjQzNmJhNWVhMjlm
|
14
|
-
MWVmNjk4MTE3NzNlMDE1NDU4ZGUyYzRlNDBlZWIwYTE3MzE1YzBiNjc3MGQw
|
15
|
-
YzM3Nzc1MWY2NzgwMmRmOGQ0ODBhZjYyMmQ0OTg2ZmMwNmNjYzI=
|
6
|
+
metadata.gz: 6c9147aed215c706094a484e249b6aaa8279ff18deab78b1a6dfe7f49a6dd4bdb1e5f1880e9cefd8a2a980fc961bd7dd38650d21b2da0bb15a576aaad97b2c4d
|
7
|
+
data.tar.gz: b261e13cc738750cfbc4438677717a819ba31b8d1f3c2bbb142409a465f335972be529d501d953cced6c56a7dce293a7a9b1428660cb8fcb58bd7eb762682ee6
|
data/README.md
CHANGED
@@ -1,35 +1,52 @@
|
|
1
1
|
# Careerjet API Client Ruby
|
2
2
|
|
3
|
-
|
3
|
+
This is the ruby client for [Careerjet](http://www.careerjet.com)'s public search API.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
Add
|
7
|
+
Add the following line to your application's Gemfile:
|
8
8
|
|
9
9
|
gem 'careerjet-api-client', :require => "careerjet/api_client"
|
10
10
|
|
11
|
-
|
11
|
+
and then execute:
|
12
12
|
|
13
13
|
$ bundle
|
14
14
|
|
15
|
-
|
15
|
+
Alternatively install it yourself:
|
16
16
|
|
17
17
|
$ gem install careerjet-api-client
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
21
|
```ruby
|
22
|
-
> cj_api_client = Careerjet::APIClient.new(:locale=> :
|
23
|
-
>
|
22
|
+
> cj_api_client = Careerjet::APIClient.new(:locale=> :en_GB)
|
23
|
+
>
|
24
|
+
> cj_api_client.search(
|
25
|
+
> :keywords => 'ruby',
|
26
|
+
> :location => 'london',
|
27
|
+
> :affid => '213e213hd12344552',
|
28
|
+
> :user_ip => '11.22.33.44',
|
29
|
+
> :user_agent => 'Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0',
|
30
|
+
> :url => 'http://www.example.com/jobsearch?q=ruby&l=london'
|
31
|
+
> )
|
32
|
+
>
|
24
33
|
=> #<Careerjet::Mash hits=5704 jobs=[<..>] pages=286 response_time=0.0434670448303223 type="JOBS">
|
25
34
|
```
|
26
35
|
|
27
|
-
You will get [Hashie::Mash](https://github.com/intridea/hashie#mash) as a response,
|
28
|
-
so you
|
36
|
+
You will get a [Hashie::Mash](https://github.com/intridea/hashie#mash) object as a response,
|
37
|
+
so you will be able to access the the data through convenient methods:
|
29
38
|
|
30
39
|
```ruby
|
31
|
-
> cj_api_client.search(
|
32
|
-
|
40
|
+
> cj_api_client.search(
|
41
|
+
> :keywords => 'ruby',
|
42
|
+
> :location => 'london',
|
43
|
+
> :affid => '213e213hd12344552',
|
44
|
+
> :user_ip => '11.22.33.44',
|
45
|
+
> :user_agent => 'Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0',
|
46
|
+
> :url => 'http://www.example.com/jobsearch?q=ruby&l=london'
|
47
|
+
> ).jobs.first
|
48
|
+
>
|
49
|
+
=> #<Careerjet::Mash company="Company Name" date="Wed, 17 Apr 2013 00:00:00 GMT" description=" <..>" url="http://...">
|
33
50
|
```
|
34
51
|
|
35
52
|
|
@@ -40,26 +57,34 @@ so you can get all data via convenient methods:
|
|
40
57
|
* `user_agent` : User agent of the end-user's browser.
|
41
58
|
* `url` : URL of page that will display the search results
|
42
59
|
|
43
|
-
###
|
60
|
+
### Search Params
|
44
61
|
|
45
|
-
|
62
|
+
Please note that each parameter is optional.
|
46
63
|
|
47
|
-
* `
|
64
|
+
* `keywords`: Keywords to match the title, content or company name of a job offer
|
48
65
|
|
49
|
-
* `
|
66
|
+
* `location`: Location of requested jobs
|
50
67
|
|
51
|
-
* `
|
68
|
+
* `sort`: Sort type. This can be: `relevance` (default) — sorted by decreasing relevancy, `date` — sorted by decreasing date and `salary` — sorted by decreasing salary.
|
52
69
|
|
53
|
-
* `
|
70
|
+
* `start_num`: Position of returned job postings within the entire result space. Should be >= 1 and <= Number of hits.
|
54
71
|
|
55
|
-
* `
|
72
|
+
* `pagesize`: Number of jobs returned in one call.
|
56
73
|
|
57
|
-
* `
|
74
|
+
* `page`: Page number of returned jobs within the entire result space. Should be >=1. If this value is set, it overrides `start_num`.
|
58
75
|
|
59
|
-
* `
|
76
|
+
* `contracttype`: Selected contract type.`p` — permanent job, `c` — contract, `t` — temporary, `i` — training, `v` — voluntary, none — all contract types.
|
60
77
|
|
61
|
-
* `
|
62
|
-
|
78
|
+
* `contractperiod`: Selected contract period. `f` — full time, `p` — part time, none — all contract periods.
|
79
|
+
|
80
|
+
### Locale code
|
81
|
+
|
82
|
+
The locale code needs to be supplied in the contructor of the API client. It defines the default location as well as the language in
|
83
|
+
which the search results are returned. Each locale corresponds to a Careerjet site.
|
84
|
+
|
85
|
+
The default is 'en_US'.
|
86
|
+
|
87
|
+
Available locale codes are:
|
63
88
|
|
64
89
|
```ruby
|
65
90
|
:cs_CZ => 'http://www.careerjet.cz' ,
|
@@ -71,7 +96,7 @@ so you can get all data via convenient methods:
|
|
71
96
|
:en_AU => 'http://www.careerjet.com.au' ,
|
72
97
|
:en_BD => 'http://www.careerjet.com.bd' ,
|
73
98
|
:en_CA => 'http://www.careerjet.ca' ,
|
74
|
-
:en_CN => 'http://
|
99
|
+
:en_CN => 'http://www.careerjet.com.cn' ,
|
75
100
|
:en_HK => 'http://www.careerjet.hk' ,
|
76
101
|
:en_IE => 'http://www.careerjet.ie' ,
|
77
102
|
:en_IN => 'http://www.careerjet.co.in' ,
|
@@ -106,7 +131,7 @@ so you can get all data via convenient methods:
|
|
106
131
|
:es_UY => 'http://www.opcionempleo.com.uy' ,
|
107
132
|
:es_VE => 'http://www.opcionempleo.com.ve' ,
|
108
133
|
:fi_FI => 'http://www.careerjet.fi' ,
|
109
|
-
:fr_CA => 'http://
|
134
|
+
:fr_CA => 'http://www.option-carriere.ca' ,
|
110
135
|
:fr_BE => 'http://www.optioncarriere.be' ,
|
111
136
|
:fr_CH => 'http://www.optioncarriere.ch' ,
|
112
137
|
:fr_FR => 'http://www.optioncarriere.com' ,
|
@@ -132,14 +157,30 @@ so you can get all data via convenient methods:
|
|
132
157
|
:zh_CN => 'http://www.careerjet.cn' ,
|
133
158
|
```
|
134
159
|
|
160
|
+
## Running the API client in Sinatra
|
161
|
+
|
162
|
+
In order to circumvent a bug when running the API client within Sinatra, you
|
163
|
+
need to tell tell Sinatra to skip the automatic Rack detection by doing:
|
164
|
+
|
165
|
+
```ruby
|
166
|
+
set :server, 'webrick'
|
167
|
+
```
|
168
|
+
|
169
|
+
You can find more information on this by Googling 'sinatra httpclient'.
|
170
|
+
|
135
171
|
|
136
172
|
## Thanks
|
137
173
|
|
138
|
-
This gem was inspired by [careerjet](https://github.com/kostia/careerjet) gem
|
174
|
+
This gem was inspired by the [careerjet](https://github.com/kostia/careerjet) gem coded by [Kostiantyn Kahanskyi](https://github.com/kostia)
|
175
|
+
and the [careerjet-rb](https://github.com/ResumUP/careerjet-rb) gem coded by [Sergey Efremov](https://github.com/EvilFaeton).
|
176
|
+
|
177
|
+
Many thanks to both.
|
139
178
|
|
140
179
|
## License
|
141
180
|
|
142
|
-
Copyright (c) 2012-
|
181
|
+
Copyright (c) 2012-2014 Sergey Efremov, Kostiantyn Kahanskyi
|
182
|
+
|
183
|
+
Copyright (c) 2015 Careerjet Ltd
|
143
184
|
|
144
185
|
MIT License
|
145
186
|
|
@@ -3,8 +3,8 @@ require File.expand_path('../lib/careerjet/version', __FILE__)
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = 'careerjet-api-client'
|
5
5
|
gem.version = Careerjet::APIClient.version
|
6
|
-
gem.description = "Ruby
|
7
|
-
gem.summary = "Ruby
|
6
|
+
gem.description = "Official Ruby interface to Careerjet's public search API"
|
7
|
+
gem.summary = "Official Ruby interface to Careerjet's public search API"
|
8
8
|
gem.homepage = 'https://github.com/careerjet/careerjet-api-client-ruby'
|
9
9
|
gem.authors = ['Sergey Efremov', 'Kostiantyn Kahanskyi','Careerjet']
|
10
10
|
gem.license = 'MIT'
|
data/lib/careerjet/constants.rb
CHANGED
@@ -14,7 +14,7 @@ module Careerjet
|
|
14
14
|
:en_AU => 'http://www.careerjet.com.au' ,
|
15
15
|
:en_BD => 'http://www.careerjet.com.bd' ,
|
16
16
|
:en_CA => 'http://www.careerjet.ca' ,
|
17
|
-
:en_CN => 'http://
|
17
|
+
:en_CN => 'http://www.careerjet.com.cn' ,
|
18
18
|
:en_HK => 'http://www.careerjet.hk' ,
|
19
19
|
:en_IE => 'http://www.careerjet.ie' ,
|
20
20
|
:en_IN => 'http://www.careerjet.co.in' ,
|
@@ -49,7 +49,7 @@ module Careerjet
|
|
49
49
|
:es_UY => 'http://www.opcionempleo.com.uy' ,
|
50
50
|
:es_VE => 'http://www.opcionempleo.com.ve' ,
|
51
51
|
:fi_FI => 'http://www.careerjet.fi' ,
|
52
|
-
:fr_CA => 'http://
|
52
|
+
:fr_CA => 'http://www.option-carriere.ca' ,
|
53
53
|
:fr_BE => 'http://www.optioncarriere.be' ,
|
54
54
|
:fr_CH => 'http://www.optioncarriere.ch' ,
|
55
55
|
:fr_FR => 'http://www.optioncarriere.com' ,
|
data/lib/careerjet/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: careerjet-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Efremov
|
@@ -16,123 +16,123 @@ dependencies:
|
|
16
16
|
name: multi_json
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '0'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rest-client
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - ">="
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '0'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: hashie
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: pry
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '0'
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- -
|
68
|
+
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: rake
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ">="
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
|
-
- -
|
82
|
+
- - ">="
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: rspec
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- -
|
89
|
+
- - ">="
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
type: :development
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
|
-
- -
|
96
|
+
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
100
|
name: webmock
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
|
-
- -
|
103
|
+
- - ">="
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: '0'
|
106
106
|
type: :development
|
107
107
|
prerelease: false
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
|
-
- -
|
110
|
+
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: yajl-ruby
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
|
-
- -
|
117
|
+
- - ">="
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
type: :development
|
121
121
|
prerelease: false
|
122
122
|
version_requirements: !ruby/object:Gem::Requirement
|
123
123
|
requirements:
|
124
|
-
- -
|
124
|
+
- - ">="
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
|
-
description: Ruby
|
127
|
+
description: Official Ruby interface to Careerjet's public search API
|
128
128
|
email:
|
129
129
|
executables: []
|
130
130
|
extensions: []
|
131
131
|
extra_rdoc_files: []
|
132
132
|
files:
|
133
|
-
- .gitignore
|
134
|
-
- .rspec
|
135
|
-
- .travis.yml
|
133
|
+
- ".gitignore"
|
134
|
+
- ".rspec"
|
135
|
+
- ".travis.yml"
|
136
136
|
- Gemfile
|
137
137
|
- README.md
|
138
138
|
- Rakefile
|
@@ -154,18 +154,18 @@ require_paths:
|
|
154
154
|
- lib
|
155
155
|
required_ruby_version: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
161
|
requirements:
|
162
|
-
- -
|
162
|
+
- - ">="
|
163
163
|
- !ruby/object:Gem::Version
|
164
164
|
version: '0'
|
165
165
|
requirements: []
|
166
166
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.
|
167
|
+
rubygems_version: 2.2.2
|
168
168
|
signing_key:
|
169
169
|
specification_version: 4
|
170
|
-
summary: Ruby
|
170
|
+
summary: Official Ruby interface to Careerjet's public search API
|
171
171
|
test_files: []
|