remote_job_scraper 0.1.0 → 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/Gemfile.lock +1 -1
- data/README.md +2 -14
- data/lib/remote_job_scraper/version.rb +1 -1
- data/lib/remote_job_scraper.rb +14 -14
- data/lib/support/spreadsheet_creator.rb +8 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bbc3d06e54e5b828ef7817799a7305d914eac90
|
4
|
+
data.tar.gz: 72a6243b5a1f0568a7e96d64c1f55bdd4036b846
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8b357f4170c3b1a4d70571c15598d2437b2f9eb24dc9c0185b37d074fd2e18ccb36f2a99230fcd28cc6f14367484b06d9ceaf2be735cb61d882175c9d25c1c6
|
7
|
+
data.tar.gz: 6789a0f0f69246f93d5390ecd6ae09e2059dea4be51770eeafef2479ed147d60c8bf3dc34b55c47e766123f1a9785383793a61d2bc53beaace05127a7016af4e
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -7,28 +7,16 @@ Going through many job listings and finding the right one may be a time-consumin
|
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
|
10
|
-
Add this line to your application's Gemfile:
|
11
|
-
|
12
|
-
```ruby
|
13
|
-
gem 'remote_job_scraper'
|
14
|
-
```
|
15
|
-
|
16
|
-
And then execute:
|
17
|
-
|
18
|
-
$ bundle
|
19
|
-
|
20
|
-
Or install it yourself as:
|
21
|
-
|
22
10
|
$ gem install remote_job_scraper
|
23
11
|
|
24
12
|
## Usage
|
25
13
|
|
26
14
|
$ bundle exec exe/remote_job_scraper
|
27
15
|
|
28
|
-
|
29
16
|
* Tested with Ruby versions:
|
30
17
|
|
31
18
|
* [x] 2.4.1
|
19
|
+
* [x] 2.0.0
|
32
20
|
|
33
21
|
## Development
|
34
22
|
|
@@ -38,7 +26,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
38
26
|
|
39
27
|
## Contributing
|
40
28
|
|
41
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
29
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/rafaltrojanowski/remote_job_scraper. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
42
30
|
|
43
31
|
## License
|
44
32
|
|
data/lib/remote_job_scraper.rb
CHANGED
@@ -15,20 +15,20 @@ require "thor"
|
|
15
15
|
|
16
16
|
module RemoteJobScraper
|
17
17
|
|
18
|
-
|
18
|
+
AVAILABLE_SITES = %w(we_work_remotely remote_ok 42jobs_rails)
|
19
19
|
|
20
20
|
class CLI < Thor
|
21
21
|
|
22
|
-
desc 'collect_jobs',
|
22
|
+
desc 'collect_jobs', "Retrieves data from #{AVAILABLE_SITES.join(', ')}"
|
23
23
|
def collect_jobs
|
24
24
|
[Sites::WeWorkRemotely, Sites::RemoteOk].each do |klass|
|
25
25
|
klass.new.collect_jobs
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
desc 'collect_jobs_from',
|
30
|
-
def collect_jobs_from(
|
31
|
-
case
|
29
|
+
desc 'collect_jobs_from SITE', "Retrieves data from SITE, e.g. #{AVAILABLE_SITES.sample}"
|
30
|
+
def collect_jobs_from(site)
|
31
|
+
case site
|
32
32
|
when 'we_work_remotely'
|
33
33
|
then Sites::WeWorkRemotely.new.collect_jobs
|
34
34
|
when 'remote_ok'
|
@@ -36,26 +36,26 @@ module RemoteJobScraper
|
|
36
36
|
when '42jobs_rails'
|
37
37
|
then Sites::JobsRails42.new.collect_jobs
|
38
38
|
else
|
39
|
-
raise "#{
|
39
|
+
raise "#{site} is not correct. Use: #{AVAILABLE_SITES.join(', ')}."
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
desc 'generate_summary', '
|
43
|
+
desc 'generate_summary', "Merges data from #{AVAILABLE_SITES.join(', ')} and exports to XLS file"
|
44
44
|
def generate_summary
|
45
45
|
Support::SpreadsheetCreator.generate
|
46
46
|
end
|
47
47
|
|
48
|
-
desc '
|
49
|
-
def
|
50
|
-
puts "
|
48
|
+
desc 'remove DIRNAME', "Removes DIRNAME (default: 'data'). Use carefully."
|
49
|
+
def remove(dirname = 'data')
|
50
|
+
puts "[Warning!]"
|
51
|
+
puts "This command will remove #{Dir.pwd}/#{dirname} permanently"
|
51
52
|
puts "Press Ctrl-C to abort."
|
52
53
|
|
53
|
-
sleep
|
54
|
+
sleep 3
|
54
55
|
|
55
|
-
FileUtils.rm_rf(
|
56
|
-
puts "Removed data."
|
56
|
+
FileUtils.rm_rf(dirname)
|
57
|
+
puts "Removed data in #{Dir.pwd}/#{dirname}."
|
57
58
|
end
|
58
|
-
|
59
59
|
end
|
60
60
|
|
61
61
|
def self.root
|
@@ -16,11 +16,18 @@ module Support
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
|
19
|
+
FileUtils.mkdir_p absolute_path(path)
|
20
|
+
|
21
|
+
book.write absolute_path(path).concat(
|
20
22
|
Time.now.strftime("%Y%m%d%H%M%S").concat('_remote_jobs_summary.xls')
|
21
23
|
)
|
22
24
|
end
|
23
25
|
|
26
|
+
def self.absolute_path(path)
|
27
|
+
return path unless ENV['RAILS_ENV'] == 'test'
|
28
|
+
"#{RemoteJobScraper.root}/spec/fixtures/#{path}"
|
29
|
+
end
|
30
|
+
|
24
31
|
def self.dirnames
|
25
32
|
if ENV['RAILS_ENV'] == 'test'
|
26
33
|
[
|