careerjet 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/Gemfile +3 -0
- data/LICENSE +22 -0
- data/README.md +33 -0
- data/Rakefile +6 -0
- data/careerejet.gemspec +20 -0
- data/lib/careerjet.rb +11 -0
- data/lib/careerjet/locales.rb +68 -0
- data/lib/careerjet/version.rb +5 -0
- data/spec/careerjet_spec.rb +11 -0
- metadata +174 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Kostiantyn Kahanskyi
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Ruby client for Careerjet's API
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
```ruby
|
6
|
+
# Gemfile
|
7
|
+
gem 'careerjet'
|
8
|
+
```
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
Careerjet.search :en_US, :keywords => 'ruby', :page => 1
|
14
|
+
```
|
15
|
+
|
16
|
+
### Params
|
17
|
+
|
18
|
+
`keywords`: Keywords to search in job offers.
|
19
|
+
|
20
|
+
`location`: Location to search job offers in.
|
21
|
+
|
22
|
+
`sort`: Type of sort. Can be: `relevance` (default) - most relevant first, `date` - freshest offer first and `salary` - biggest salary first.
|
23
|
+
|
24
|
+
`start_num`: Number of first offer returned in entire result space. Should be >= 1 and <= Number of hits.
|
25
|
+
|
26
|
+
`pagesize`: Number of offers returned in one call.
|
27
|
+
|
28
|
+
`page`: Number of the asked page. Should be >=1. If this value is set, the eventually given `start_num` is overrided.
|
29
|
+
|
30
|
+
`contracttype`: Character code for contract type.`p` - permanent job, `c`- contract, `t`- temporary, `i`- training, `v`- voluntary, none - all contract types.
|
31
|
+
|
32
|
+
`contractperiod`: Character code for contract work period. `f` - full time, `p` - part time, none - all work period.
|
33
|
+
|
data/Rakefile
ADDED
data/careerejet.gemspec
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require File.expand_path('../lib/careerjet/version', __FILE__)
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.name = 'careerjet'
|
5
|
+
gem.version = Careerjet.version
|
6
|
+
gem.description = "Ruby client for Careerjet's API"
|
7
|
+
gem.summary = "Ruby client for Careerjet's API"
|
8
|
+
gem.homepage = 'https://github.com/kostia/careerjet'
|
9
|
+
gem.authors = ['Kostiantyn Kahanskyi']
|
10
|
+
gem.email = %w[kostiantyn.kahanskyi@googlemail.com]
|
11
|
+
gem.files = `git ls-files`.split("\n")
|
12
|
+
gem.require_paths = %w[lib]
|
13
|
+
gem.add_dependency 'multi_json'
|
14
|
+
gem.add_dependency 'rest-client'
|
15
|
+
gem.add_development_dependency 'pry'
|
16
|
+
gem.add_development_dependency 'rake'
|
17
|
+
gem.add_development_dependency 'rspec'
|
18
|
+
gem.add_development_dependency 'webmock'
|
19
|
+
gem.add_development_dependency 'yajl-ruby' # To avoid warning from MultiJson
|
20
|
+
end
|
data/lib/careerjet.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'multi_json'
|
2
|
+
require 'rest_client'
|
3
|
+
|
4
|
+
require 'careerjet/locales'
|
5
|
+
require 'careerjet/version'
|
6
|
+
|
7
|
+
module Careerjet
|
8
|
+
def self.search(locale, params)
|
9
|
+
MultiJson.decode(RestClient::Resource.new(LOCALES[locale])['/devel/search.api'].get(params))
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
module Careerjet
|
2
|
+
LOCALES = {
|
3
|
+
:cs_CZ => 'http://www.careerjet.cz' ,
|
4
|
+
:da_DK => 'http://www.careerjet.dk' ,
|
5
|
+
:de_AT => 'http://www.careerjet.at' ,
|
6
|
+
:de_CH => 'http://www.careerjet.ch' ,
|
7
|
+
:de_DE => 'http://www.careerjet.de' ,
|
8
|
+
:en_AE => 'http://www.careerjet.ae' ,
|
9
|
+
:en_AU => 'http://www.careerjet.com.au' ,
|
10
|
+
:en_CA => 'http://www.careerjet.ca' ,
|
11
|
+
:en_CN => 'http://en.careerjet.cn' ,
|
12
|
+
:en_HK => 'http://www.careerjet.hk' ,
|
13
|
+
:en_IE => 'http://www.careerjet.ie' ,
|
14
|
+
:en_IN => 'http://www.careerjet.co.in' ,
|
15
|
+
:en_MY => 'http://www.careerjet.com.my' ,
|
16
|
+
:en_NZ => 'http://www.careerjet.co.nz' ,
|
17
|
+
:en_OM => 'http://www.careerjet.com.om' ,
|
18
|
+
:en_PH => 'http://www.careerjet.ph' ,
|
19
|
+
:en_PK => 'http://www.careerjet.com.pk' ,
|
20
|
+
:en_QA => 'http://www.careerjet.com.qa' ,
|
21
|
+
:en_SG => 'http://www.careerjet.sg' ,
|
22
|
+
:en_GB => 'http://www.careerjet.co.uk' ,
|
23
|
+
:en_US => 'http://www.careerjet.com' ,
|
24
|
+
:en_ZA => 'http://www.careerjet.co.za' ,
|
25
|
+
:en_TW => 'http://www.careerjet.com.tw' ,
|
26
|
+
:en_VN => 'http://www.careerjet.vn' ,
|
27
|
+
:es_AR => 'http://www.opcionempleo.com.ar' ,
|
28
|
+
:es_BO => 'http://www.opcionempleo.com.bo' ,
|
29
|
+
:es_CL => 'http://www.opcionempleo.cl' ,
|
30
|
+
:es_CR => 'http://www.opcionempleo.co.cr' ,
|
31
|
+
:es_DO => 'http://www.opcionempleo.com.do' ,
|
32
|
+
:es_EC => 'http://www.opcionempleo.ec' ,
|
33
|
+
:es_ES => 'http://www.opcionempleo.com' ,
|
34
|
+
:es_GT => 'http://www.opcionempleo.com.gt' ,
|
35
|
+
:es_MX => 'http://www.opcionempleo.com.mx' ,
|
36
|
+
:es_PA => 'http://www.opcionempleo.com.pa' ,
|
37
|
+
:es_PE => 'http://www.opcionempleo.com.pe' ,
|
38
|
+
:es_PR => 'http://www.opcionempleo.com.pr' ,
|
39
|
+
:es_PY => 'http://www.opcionempleo.com.py' ,
|
40
|
+
:es_UY => 'http://www.opcionempleo.com.uy' ,
|
41
|
+
:es_VE => 'http://www.opcionempleo.com.ve' ,
|
42
|
+
:fi_FI => 'http://www.careerjet.fi' ,
|
43
|
+
:fr_CA => 'http://fr.careerjet.ca' ,
|
44
|
+
:fr_BE => 'http://www.optioncarriere.be' ,
|
45
|
+
:fr_CH => 'http://www.optioncarriere.ch' ,
|
46
|
+
:fr_FR => 'http://www.optioncarriere.com' ,
|
47
|
+
:fr_LU => 'http://www.optioncarriere.lu' ,
|
48
|
+
:fr_MA => 'http://www.optioncarriere.ma' ,
|
49
|
+
:hu_HU => 'http://www.careerjet.hu' ,
|
50
|
+
:it_IT => 'http://www.careerjet.it' ,
|
51
|
+
:ja_JP => 'http://www.careerjet.jp' ,
|
52
|
+
:ko_KR => 'http://www.careerjet.co.kr' ,
|
53
|
+
:nl_BE => 'http://www.careerjet.be' ,
|
54
|
+
:nl_NL => 'http://www.careerjet.nl' ,
|
55
|
+
:no_NO => 'http://www.careerjet.no' ,
|
56
|
+
:pl_PL => 'http://www.careerjet.pl' ,
|
57
|
+
:pt_PT => 'http://www.careerjet.pt' ,
|
58
|
+
:pt_BR => 'http://www.careerjet.com.br' ,
|
59
|
+
:ru_RU => 'http://www.careerjet.ru' ,
|
60
|
+
:ru_UA => 'http://www.careerjet.com.ua' ,
|
61
|
+
:sv_SE => 'http://www.careerjet.se' ,
|
62
|
+
:sk_SK => 'http://www.careerjet.sk' ,
|
63
|
+
:tr_TR => 'http://www.careerjet.com.tr' ,
|
64
|
+
:uk_UA => 'http://www.careerjet.ua' ,
|
65
|
+
:vi_VN => 'http://www.careerjet.com.vn' ,
|
66
|
+
:zh_CN => 'http://www.careerjet.cn' ,
|
67
|
+
}
|
68
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'webmock/rspec'
|
2
|
+
require 'careerjet'
|
3
|
+
|
4
|
+
describe Careerjet do
|
5
|
+
it "should request Careejet's search API with correct domain and given params" do
|
6
|
+
resp = {'hits' => 1, 'response_time' => 0.001, 'type' => 'JOBS', 'pages' => 1}
|
7
|
+
stub_http_request(:get, 'www.careerjet.com/devel/search.api').to_return(
|
8
|
+
:body => MultiJson.encode(resp))
|
9
|
+
Careerjet.search(:en_US, :keywords => 'rails', :page => 1).should == resp
|
10
|
+
end
|
11
|
+
end
|
metadata
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: careerjet
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Kostiantyn Kahanskyi
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2012-07-18 00:00:00 +02:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
type: :runtime
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
32
|
+
prerelease: false
|
33
|
+
name: multi_json
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
type: :runtime
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 3
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
version: "0"
|
46
|
+
prerelease: false
|
47
|
+
name: rest-client
|
48
|
+
version_requirements: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
type: :development
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: 3
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
version: "0"
|
60
|
+
prerelease: false
|
61
|
+
name: pry
|
62
|
+
version_requirements: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
type: :development
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
74
|
+
prerelease: false
|
75
|
+
name: rake
|
76
|
+
version_requirements: *id004
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
type: :development
|
79
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
hash: 3
|
85
|
+
segments:
|
86
|
+
- 0
|
87
|
+
version: "0"
|
88
|
+
prerelease: false
|
89
|
+
name: rspec
|
90
|
+
version_requirements: *id005
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
type: :development
|
93
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
hash: 3
|
99
|
+
segments:
|
100
|
+
- 0
|
101
|
+
version: "0"
|
102
|
+
prerelease: false
|
103
|
+
name: webmock
|
104
|
+
version_requirements: *id006
|
105
|
+
- !ruby/object:Gem::Dependency
|
106
|
+
type: :development
|
107
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
hash: 3
|
113
|
+
segments:
|
114
|
+
- 0
|
115
|
+
version: "0"
|
116
|
+
prerelease: false
|
117
|
+
name: yajl-ruby
|
118
|
+
version_requirements: *id007
|
119
|
+
description: Ruby client for Careerjet's API
|
120
|
+
email:
|
121
|
+
- kostiantyn.kahanskyi@googlemail.com
|
122
|
+
executables: []
|
123
|
+
|
124
|
+
extensions: []
|
125
|
+
|
126
|
+
extra_rdoc_files: []
|
127
|
+
|
128
|
+
files:
|
129
|
+
- .gitignore
|
130
|
+
- Gemfile
|
131
|
+
- LICENSE
|
132
|
+
- README.md
|
133
|
+
- Rakefile
|
134
|
+
- careerejet.gemspec
|
135
|
+
- lib/careerjet.rb
|
136
|
+
- lib/careerjet/locales.rb
|
137
|
+
- lib/careerjet/version.rb
|
138
|
+
- spec/careerjet_spec.rb
|
139
|
+
has_rdoc: true
|
140
|
+
homepage: https://github.com/kostia/careerjet
|
141
|
+
licenses: []
|
142
|
+
|
143
|
+
post_install_message:
|
144
|
+
rdoc_options: []
|
145
|
+
|
146
|
+
require_paths:
|
147
|
+
- lib
|
148
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
149
|
+
none: false
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
hash: 3
|
154
|
+
segments:
|
155
|
+
- 0
|
156
|
+
version: "0"
|
157
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
|
+
none: false
|
159
|
+
requirements:
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
hash: 3
|
163
|
+
segments:
|
164
|
+
- 0
|
165
|
+
version: "0"
|
166
|
+
requirements: []
|
167
|
+
|
168
|
+
rubyforge_project:
|
169
|
+
rubygems_version: 1.6.2
|
170
|
+
signing_key:
|
171
|
+
specification_version: 3
|
172
|
+
summary: Ruby client for Careerjet's API
|
173
|
+
test_files: []
|
174
|
+
|