hawatel_search_jobs 0.1.3 → 0.2.0
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 +4 -4
- data/.codeclimate.yml +17 -18
- data/.gitignore +11 -11
- data/.rspec +2 -2
- data/.rubocop.yml +1169 -1169
- data/.travis.yml +6 -6
- data/CODE_OF_CONDUCT.md +13 -13
- data/CONTRIBUTING.md +69 -69
- data/Gemfile +4 -4
- data/LICENSE.txt +21 -21
- data/README.md +12 -7
- data/Rakefile +6 -6
- data/hawatel_search_jobs.gemspec +32 -32
- data/lib/hawatel_search_jobs.rb +64 -64
- data/lib/hawatel_search_jobs/api.rb +9 -9
- data/lib/hawatel_search_jobs/api/careerbuilder.rb +172 -169
- data/lib/hawatel_search_jobs/api/careerjet.rb +131 -126
- data/lib/hawatel_search_jobs/api/indeed.rb +166 -157
- data/lib/hawatel_search_jobs/api/reed.rb +189 -185
- data/lib/hawatel_search_jobs/api/xing.rb +16 -6
- data/lib/hawatel_search_jobs/client.rb +170 -172
- data/lib/hawatel_search_jobs/version.rb +1 -1
- data/spec/careerbuilder_spec.rb +142 -82
- data/spec/careerjet_spec.rb +97 -58
- data/spec/client_spec.rb +75 -87
- data/spec/indeed_spec.rb +97 -59
- data/spec/reed_spec.rb +93 -77
- data/spec/spec_helper.rb +2 -2
- data/spec/xing_spec.rb +66 -46
- metadata +2 -2
data/.travis.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.0.0
|
4
|
-
- 2.1.0
|
5
|
-
- 2.2.1
|
6
|
-
- 2.2.4
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.0.0
|
4
|
+
- 2.1.0
|
5
|
+
- 2.2.1
|
6
|
+
- 2.2.4
|
7
7
|
before_install: gem install bundler -v 1.10.6
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
# Contributor Code of Conduct
|
2
|
-
|
3
|
-
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
-
|
5
|
-
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
-
|
7
|
-
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
-
|
9
|
-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
-
|
11
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
-
|
13
|
-
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/CONTRIBUTING.md
CHANGED
@@ -1,70 +1,70 @@
|
|
1
|
-
# Contributing
|
2
|
-
|
3
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/Hawatel/hawatel_search_jobs. This project is intended to be a safe, welcoming space for collaboration, and contributors.
|
4
|
-
|
5
|
-
1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork,
|
6
|
-
and configure the remotes:
|
7
|
-
|
8
|
-
```sh
|
9
|
-
# Clone your fork of the repo into the current directory
|
10
|
-
git clone https://github.com/<your-username>/hawatel_search_jobs
|
11
|
-
# Navigate to the newly cloned directory
|
12
|
-
cd hawatel_search_jobs
|
13
|
-
# Assign the original repo to a remote called "upstream"
|
14
|
-
git remote add upstream https://github.com/Hawatel/hawatel_search_jobs
|
15
|
-
```
|
16
|
-
|
17
|
-
2. If you cloned a while ago, get the latest changes from upstream:
|
18
|
-
|
19
|
-
```bash
|
20
|
-
git checkout master
|
21
|
-
git pull upstream master
|
22
|
-
```
|
23
|
-
|
24
|
-
3. Create a new topic branch (off of `master`) to contain your feature, change,
|
25
|
-
or fix.
|
26
|
-
|
27
|
-
**IMPORTANT**: Making changes in `master` is discouraged. You should always
|
28
|
-
keep your local `master` in sync with upstream `master` and make your
|
29
|
-
changes in topic branches.
|
30
|
-
|
31
|
-
```sh
|
32
|
-
git checkout -b <topic-branch-name>
|
33
|
-
```
|
34
|
-
|
35
|
-
4. Commit your changes in logical chunks. Keep your commit messages organized,
|
36
|
-
with a short description in the first line and more detailed information on
|
37
|
-
the following lines. Feel free to use Git's
|
38
|
-
[interactive rebase](https://help.github.com/articles/about-git-rebase/)
|
39
|
-
feature to tidy up your commits before making them public.
|
40
|
-
|
41
|
-
5. Make sure all the tests are still passing.
|
42
|
-
|
43
|
-
```sh
|
44
|
-
rake
|
45
|
-
```
|
46
|
-
|
47
|
-
6. Push your topic branch up to your fork:
|
48
|
-
|
49
|
-
```sh
|
50
|
-
git push origin <topic-branch-name>
|
51
|
-
```
|
52
|
-
|
53
|
-
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
|
54
|
-
with a clear title and description.
|
55
|
-
|
56
|
-
8. If you haven't updated your pull request for a while, you should consider
|
57
|
-
rebasing on master and resolving any conflicts.
|
58
|
-
|
59
|
-
**IMPORTANT**: _Never ever_ merge upstream `master` into your branches. You
|
60
|
-
should always `git rebase` on `master` to bring your changes up to date when
|
61
|
-
necessary.
|
62
|
-
|
63
|
-
```sh
|
64
|
-
git checkout master
|
65
|
-
git pull upstream master
|
66
|
-
git checkout <your-topic-branch>
|
67
|
-
git rebase master
|
68
|
-
```
|
69
|
-
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Hawatel/hawatel_search_jobs. This project is intended to be a safe, welcoming space for collaboration, and contributors.
|
4
|
+
|
5
|
+
1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork,
|
6
|
+
and configure the remotes:
|
7
|
+
|
8
|
+
```sh
|
9
|
+
# Clone your fork of the repo into the current directory
|
10
|
+
git clone https://github.com/<your-username>/hawatel_search_jobs
|
11
|
+
# Navigate to the newly cloned directory
|
12
|
+
cd hawatel_search_jobs
|
13
|
+
# Assign the original repo to a remote called "upstream"
|
14
|
+
git remote add upstream https://github.com/Hawatel/hawatel_search_jobs
|
15
|
+
```
|
16
|
+
|
17
|
+
2. If you cloned a while ago, get the latest changes from upstream:
|
18
|
+
|
19
|
+
```bash
|
20
|
+
git checkout master
|
21
|
+
git pull upstream master
|
22
|
+
```
|
23
|
+
|
24
|
+
3. Create a new topic branch (off of `master`) to contain your feature, change,
|
25
|
+
or fix.
|
26
|
+
|
27
|
+
**IMPORTANT**: Making changes in `master` is discouraged. You should always
|
28
|
+
keep your local `master` in sync with upstream `master` and make your
|
29
|
+
changes in topic branches.
|
30
|
+
|
31
|
+
```sh
|
32
|
+
git checkout -b <topic-branch-name>
|
33
|
+
```
|
34
|
+
|
35
|
+
4. Commit your changes in logical chunks. Keep your commit messages organized,
|
36
|
+
with a short description in the first line and more detailed information on
|
37
|
+
the following lines. Feel free to use Git's
|
38
|
+
[interactive rebase](https://help.github.com/articles/about-git-rebase/)
|
39
|
+
feature to tidy up your commits before making them public.
|
40
|
+
|
41
|
+
5. Make sure all the tests are still passing.
|
42
|
+
|
43
|
+
```sh
|
44
|
+
rake
|
45
|
+
```
|
46
|
+
|
47
|
+
6. Push your topic branch up to your fork:
|
48
|
+
|
49
|
+
```sh
|
50
|
+
git push origin <topic-branch-name>
|
51
|
+
```
|
52
|
+
|
53
|
+
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
|
54
|
+
with a clear title and description.
|
55
|
+
|
56
|
+
8. If you haven't updated your pull request for a while, you should consider
|
57
|
+
rebasing on master and resolving any conflicts.
|
58
|
+
|
59
|
+
**IMPORTANT**: _Never ever_ merge upstream `master` into your branches. You
|
60
|
+
should always `git rebase` on `master` to bring your changes up to date when
|
61
|
+
necessary.
|
62
|
+
|
63
|
+
```sh
|
64
|
+
git checkout master
|
65
|
+
git pull upstream master
|
66
|
+
git checkout <your-topic-branch>
|
67
|
+
git rebase master
|
68
|
+
```
|
69
|
+
|
70
70
|
Thank you for your contributions!
|
data/Gemfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Specify your gem's dependencies in hawatel_search_jobs.gemspec
|
4
|
-
gemspec
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in hawatel_search_jobs.gemspec
|
4
|
+
gemspec
|
data/LICENSE.txt
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2016 Daniel Iwaniuk
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Daniel Iwaniuk
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -35,25 +35,30 @@ HawatelSearchJobs.configure do |config|
|
|
35
35
|
config.indeed[:api] = 'api.indeed.com'
|
36
36
|
config.indeed[:version] = '2'
|
37
37
|
config.indeed[:publisher] = 'secret-key'
|
38
|
+
config.indeed[:page_size] = 25 # allowed range <1,25>
|
38
39
|
|
39
40
|
config.xing[:activated] = true
|
40
41
|
config.xing[:consumer_key] = 'secret-key'
|
41
42
|
config.xing[:consumer_secret] = 'secret-key'
|
42
43
|
config.xing[:oauth_token] = 'secret-key'
|
43
44
|
config.xing[:oauth_token_secret] = 'secret-key'
|
45
|
+
config.xing[:page_size] = 25 # allowed range <1,100>
|
44
46
|
|
45
47
|
config.reed[:activated] = true
|
46
48
|
config.reed[:api] = 'reed.co.uk/api'
|
47
49
|
config.reed[:clientid] = 'secret-key'
|
48
50
|
config.reed[:version] = '1.0'
|
51
|
+
config.reed[:page_size] = 25 # allowed range <1,100>
|
49
52
|
|
50
53
|
config.careerbuilder[:activated] = true
|
51
54
|
config.careerbuilder[:api] = 'api.careerbuilder.com'
|
52
55
|
config.careerbuilder[:clientid] = 'secret-key'
|
53
56
|
config.careerbuilder[:version] = 'v2'
|
57
|
+
config.careerbuilder[:page_size] = 25 # allowed range <1,100>
|
54
58
|
|
55
59
|
config.careerjet[:activated] = true
|
56
60
|
config.careerjet[:api] = 'public.api.careerjet.net'
|
61
|
+
config.careerjet[:page_size] = 25 # allowed range <1,99>
|
57
62
|
end
|
58
63
|
```
|
59
64
|
|
@@ -86,7 +91,8 @@ Instance variable *jobs_table* always has last returned job offers.
|
|
86
91
|
p client.jobs_table
|
87
92
|
```
|
88
93
|
|
89
|
-
Each API has a limit of returned records. For consistency, each API returns maximum `25` records.
|
94
|
+
Each API has a default limit of returned records. For consistency, each API returns maximum `25` records.
|
95
|
+
You can change this behavior by setting page_size option in block of HawatelSearchJobs.configure method.
|
90
96
|
|
91
97
|
#### Get next page of job offers
|
92
98
|
```ruby
|
@@ -99,9 +105,9 @@ Each API has a limit of returned records. For consistency, each API returns maxi
|
|
99
105
|
```ruby
|
100
106
|
client = HawatelSearchJobs::Client.new
|
101
107
|
client.search_jobs({:keywords => 'ruby'})
|
102
|
-
|
108
|
+
|
103
109
|
job_offers = Array.new
|
104
|
-
|
110
|
+
|
105
111
|
begin
|
106
112
|
job_offers << client.jobs_table
|
107
113
|
end while(client.next)
|
@@ -124,15 +130,15 @@ Below is an example for indeed but each API has the same result structure.
|
|
124
130
|
client = HawatelSearchJobs::Client.new
|
125
131
|
client.search_jobs({:keywords => 'ruby'})
|
126
132
|
result = client.jobs_table
|
127
|
-
|
133
|
+
|
128
134
|
result[:indeed][:code] # HTTP status code (see https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
|
129
135
|
result[:indeed][:message] # HTTP message (seee https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
|
130
|
-
|
136
|
+
|
131
137
|
result[:indeed][:totalResults] # Total results of job offers which matches to your search criteria on API provider
|
132
138
|
result[:indeed][:page] # Current results page number counted from index 0
|
133
139
|
result[:indeed][:last] # Last results page number
|
134
140
|
result[:indeed][:key] # Internal key which usuely keep last URL sent to API or last used keywords
|
135
|
-
|
141
|
+
|
136
142
|
result[:indeed][:jobs] # OpenStruct array which store returned job offers from API provider
|
137
143
|
result[:indeed][:jobs].jobtitle # Job title
|
138
144
|
result[:indeed][:jobs].location # Job location
|
@@ -149,4 +155,3 @@ See [CONTRIBUTING](CONTRIBUTING.md)
|
|
149
155
|
## License
|
150
156
|
|
151
157
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
152
|
-
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
require "rspec/core/rake_task"
|
3
|
-
|
4
|
-
RSpec::Core::RakeTask.new(:spec)
|
5
|
-
|
6
|
-
task :default => :spec
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
3
|
+
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
|
6
|
+
task :default => :spec
|
data/hawatel_search_jobs.gemspec
CHANGED
@@ -1,32 +1,32 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'hawatel_search_jobs/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "hawatel_search_jobs"
|
8
|
-
spec.version = HawatelSearchJobs::VERSION
|
9
|
-
spec.authors = ['Przemyslaw Mantaj','Daniel Iwaniuk']
|
10
|
-
spec.email = ['przemyslaw.mantaj@hawatel.com', 'daniel.iwaniuk@hawatel.com']
|
11
|
-
|
12
|
-
spec.summary = %q{Hawatel_search_jobs, it is gem which provides ease access to API from popular job websites to get current job offers.}
|
13
|
-
spec.description = %q{Hawatel_search_jobs, it is gem which provides ease access to API from popular job websites
|
14
|
-
to get current job offers. At this moment, supported backends are indeed.com, careerjet.com,
|
15
|
-
xing.com, careerbuilder.com and reed.co.uk.}
|
16
|
-
spec.homepage = "http://github.com/Hawatel/hawatel_search_jobs"
|
17
|
-
spec.license = "MIT"
|
18
|
-
|
19
|
-
spec.files = `git ls-files`.split($/)
|
20
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
22
|
-
spec.require_paths = ["lib"]
|
23
|
-
|
24
|
-
spec.required_ruby_version = '>= 2.0.0'
|
25
|
-
|
26
|
-
spec.add_runtime_dependency 'xing_api'
|
27
|
-
spec.add_runtime_dependency 'activesupport'
|
28
|
-
|
29
|
-
spec.add_development_dependency "bundler", "~> 1.10"
|
30
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
31
|
-
spec.add_development_dependency "rspec"
|
32
|
-
end
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'hawatel_search_jobs/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "hawatel_search_jobs"
|
8
|
+
spec.version = HawatelSearchJobs::VERSION
|
9
|
+
spec.authors = ['Przemyslaw Mantaj','Daniel Iwaniuk']
|
10
|
+
spec.email = ['przemyslaw.mantaj@hawatel.com', 'daniel.iwaniuk@hawatel.com']
|
11
|
+
|
12
|
+
spec.summary = %q{Hawatel_search_jobs, it is gem which provides ease access to API from popular job websites to get current job offers.}
|
13
|
+
spec.description = %q{Hawatel_search_jobs, it is gem which provides ease access to API from popular job websites
|
14
|
+
to get current job offers. At this moment, supported backends are indeed.com, careerjet.com,
|
15
|
+
xing.com, careerbuilder.com and reed.co.uk.}
|
16
|
+
spec.homepage = "http://github.com/Hawatel/hawatel_search_jobs"
|
17
|
+
spec.license = "MIT"
|
18
|
+
|
19
|
+
spec.files = `git ls-files`.split($/)
|
20
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.required_ruby_version = '>= 2.0.0'
|
25
|
+
|
26
|
+
spec.add_runtime_dependency 'xing_api'
|
27
|
+
spec.add_runtime_dependency 'activesupport'
|
28
|
+
|
29
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
30
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
31
|
+
spec.add_development_dependency "rspec"
|
32
|
+
end
|
data/lib/hawatel_search_jobs.rb
CHANGED
@@ -1,64 +1,64 @@
|
|
1
|
-
##
|
2
|
-
# = Hawatel Search Jobs
|
3
|
-
# More details how to use it was described here {HawatelSearchJobs::Client}
|
4
|
-
module HawatelSearchJobs
|
5
|
-
require 'hawatel_search_jobs/helpers'
|
6
|
-
require 'hawatel_search_jobs/api'
|
7
|
-
require 'hawatel_search_jobs/client'
|
8
|
-
|
9
|
-
class << self
|
10
|
-
attr_accessor :indeed, :xing, :reed, :careerbuilder, :careerjet
|
11
|
-
|
12
|
-
##
|
13
|
-
# How to configure APIs go to example {HawatelSearchJobs::Client#search_jobs}
|
14
|
-
def configure
|
15
|
-
@indeed = default_indeed(Hash.new)
|
16
|
-
@xing = default_xing(Hash.new)
|
17
|
-
@reed = default_reed(Hash.new)
|
18
|
-
@careerbuilder = default_careerbuilder(Hash.new)
|
19
|
-
@careerjet = default_careerjet(Hash.new)
|
20
|
-
yield self
|
21
|
-
true
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
def default_xing(settings)
|
27
|
-
settings[:activated] = false
|
28
|
-
settings[:consumer_key] = ''
|
29
|
-
settings[:consumer_secret] = ''
|
30
|
-
settings[:oauth_token] = ''
|
31
|
-
settings[:oauth_token_secret] = ''
|
32
|
-
return settings
|
33
|
-
end
|
34
|
-
|
35
|
-
def default_indeed(settings)
|
36
|
-
settings[:activated] = false
|
37
|
-
settings[:api] = 'api.indeed.com'
|
38
|
-
settings[:version] = '2'
|
39
|
-
settings[:publisher] = ''
|
40
|
-
return settings
|
41
|
-
end
|
42
|
-
|
43
|
-
def default_careerjet(settings)
|
44
|
-
settings[:activated] = false
|
45
|
-
settings[:api] = 'public.api.careerjet.net'
|
46
|
-
return settings
|
47
|
-
end
|
48
|
-
|
49
|
-
def default_reed(settings)
|
50
|
-
settings[:activated] = false
|
51
|
-
settings[:api] = 'reed.co.uk/api'
|
52
|
-
settings[:version] = '1.0'
|
53
|
-
return settings
|
54
|
-
end
|
55
|
-
|
56
|
-
def default_careerbuilder(settings)
|
57
|
-
settings[:activated] = false
|
58
|
-
settings[:api] = 'api.careerbuilder.com'
|
59
|
-
settings[:version] = 'v2'
|
60
|
-
return settings
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
1
|
+
##
|
2
|
+
# = Hawatel Search Jobs
|
3
|
+
# More details how to use it was described here {HawatelSearchJobs::Client}
|
4
|
+
module HawatelSearchJobs
|
5
|
+
require 'hawatel_search_jobs/helpers'
|
6
|
+
require 'hawatel_search_jobs/api'
|
7
|
+
require 'hawatel_search_jobs/client'
|
8
|
+
|
9
|
+
class << self
|
10
|
+
attr_accessor :indeed, :xing, :reed, :careerbuilder, :careerjet
|
11
|
+
|
12
|
+
##
|
13
|
+
# How to configure APIs go to example {HawatelSearchJobs::Client#search_jobs}
|
14
|
+
def configure
|
15
|
+
@indeed = default_indeed(Hash.new)
|
16
|
+
@xing = default_xing(Hash.new)
|
17
|
+
@reed = default_reed(Hash.new)
|
18
|
+
@careerbuilder = default_careerbuilder(Hash.new)
|
19
|
+
@careerjet = default_careerjet(Hash.new)
|
20
|
+
yield self
|
21
|
+
true
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def default_xing(settings)
|
27
|
+
settings[:activated] = false
|
28
|
+
settings[:consumer_key] = ''
|
29
|
+
settings[:consumer_secret] = ''
|
30
|
+
settings[:oauth_token] = ''
|
31
|
+
settings[:oauth_token_secret] = ''
|
32
|
+
return settings
|
33
|
+
end
|
34
|
+
|
35
|
+
def default_indeed(settings)
|
36
|
+
settings[:activated] = false
|
37
|
+
settings[:api] = 'api.indeed.com'
|
38
|
+
settings[:version] = '2'
|
39
|
+
settings[:publisher] = ''
|
40
|
+
return settings
|
41
|
+
end
|
42
|
+
|
43
|
+
def default_careerjet(settings)
|
44
|
+
settings[:activated] = false
|
45
|
+
settings[:api] = 'public.api.careerjet.net'
|
46
|
+
return settings
|
47
|
+
end
|
48
|
+
|
49
|
+
def default_reed(settings)
|
50
|
+
settings[:activated] = false
|
51
|
+
settings[:api] = 'reed.co.uk/api'
|
52
|
+
settings[:version] = '1.0'
|
53
|
+
return settings
|
54
|
+
end
|
55
|
+
|
56
|
+
def default_careerbuilder(settings)
|
57
|
+
settings[:activated] = false
|
58
|
+
settings[:api] = 'api.careerbuilder.com'
|
59
|
+
settings[:version] = 'v2'
|
60
|
+
return settings
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|