cat_claw 0.0.4 → 0.0.5
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/bin/catclaw +1 -2
- data/lib/cat_claw/catcher.rb +9 -13
- data/lib/cat_claw/cats/ruby_china_cat.rb +2 -2
- data/lib/cat_claw/cats/stack_over_flow_cat.rb +2 -2
- data/lib/cat_claw/cats/v2ex_cat.rb +2 -2
- data/lib/cat_claw/cats/we_work_remotely_cat.rb +2 -2
- data/lib/cat_claw/version.rb +1 -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: 93e8012f94dc1aace75dc27ad7bbee3c2e4aeaa8
|
4
|
+
data.tar.gz: c7658ac2adffe39092a9790008a8df4503dea1da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efbdee35a85a888ce05e5191c09f6c72310997c2e1e0c9f742f0755b83911a61a93d4284d109e590e0ae99840e1af45d1012598b8e9d3abdc5b850a90f7457be
|
7
|
+
data.tar.gz: 5986115cf23503e94d270e6527c134603e6ffaba770f69abd5dacb05a0f35fc615321d01d5e10a5a74fb0c612c0831fd575e7d85360ada5c6078db2689c1c8e3
|
data/bin/catclaw
CHANGED
data/lib/cat_claw/catcher.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
require 'optparse'
|
2
2
|
|
3
3
|
module CatClaw
|
4
|
+
def self.catch
|
5
|
+
Catcher.new.paw
|
6
|
+
end
|
7
|
+
|
4
8
|
class Catcher
|
5
|
-
def initialize
|
6
|
-
@arguments = arguments
|
9
|
+
def initialize
|
7
10
|
@cats = [
|
8
11
|
CatClaw::RubyChinaCat.new,
|
9
12
|
CatClaw::V2EXCat.new,
|
@@ -13,23 +16,16 @@ module CatClaw
|
|
13
16
|
end
|
14
17
|
|
15
18
|
def paw
|
16
|
-
|
19
|
+
footprints = []
|
17
20
|
@cats.each do |cat|
|
18
|
-
|
21
|
+
footprint = cat.paw
|
22
|
+
footprints << footprint
|
19
23
|
end
|
24
|
+
footprints
|
20
25
|
end
|
21
26
|
|
22
27
|
def run
|
23
28
|
paw
|
24
29
|
end
|
25
|
-
|
26
|
-
private
|
27
|
-
|
28
|
-
def parse_options
|
29
|
-
options = OptionParser.new
|
30
|
-
options.banner = "Usage: catclaw [options]"
|
31
|
-
options.on('-d', '--download', "Download all photos after pulling" ) { @cats.download = true }
|
32
|
-
options.parse!(@arguments)
|
33
|
-
end
|
34
30
|
end
|
35
31
|
end
|
@@ -22,7 +22,7 @@ module CatClaw
|
|
22
22
|
|
23
23
|
private
|
24
24
|
def whisper page
|
25
|
-
puts 'opening URI ... '
|
25
|
+
puts 'opening URI ... ruby-china'
|
26
26
|
url = @base_url + "/jobs?page=" + page.to_s
|
27
27
|
doc = Nokogiri::HTML(open(url))
|
28
28
|
topics = doc.css(".topic .infos .title a")
|
@@ -36,7 +36,7 @@ module CatClaw
|
|
36
36
|
@footprint[:jobs] << {
|
37
37
|
url: url,
|
38
38
|
title: title,
|
39
|
-
|
39
|
+
content: content,
|
40
40
|
scope: "China",
|
41
41
|
job_type: "developer",
|
42
42
|
}
|
@@ -19,7 +19,7 @@ module CatClaw
|
|
19
19
|
|
20
20
|
private
|
21
21
|
def whisper
|
22
|
-
puts 'opening URI ... '
|
22
|
+
puts 'opening URI ... stackoverflow'
|
23
23
|
url = @base_url + "/jobs/remote"
|
24
24
|
doc = Nokogiri::HTML(open(url))
|
25
25
|
topics = doc.css(".jobs div h3 a")
|
@@ -31,7 +31,7 @@ module CatClaw
|
|
31
31
|
@footprint[:jobs] << {
|
32
32
|
url: url,
|
33
33
|
title: title,
|
34
|
-
|
34
|
+
content: content,
|
35
35
|
scope: "World",
|
36
36
|
job_type: "developer",
|
37
37
|
}
|
@@ -22,7 +22,7 @@ module CatClaw
|
|
22
22
|
|
23
23
|
private
|
24
24
|
def whisper page
|
25
|
-
puts 'opening URI ... '
|
25
|
+
puts 'opening URI ... v2ex'
|
26
26
|
url = @base_url + "/go/jobs?p=" + page.to_s
|
27
27
|
doc = Nokogiri::HTML(open(url))
|
28
28
|
topics = doc.css(".item_title a")
|
@@ -35,7 +35,7 @@ module CatClaw
|
|
35
35
|
@footprint[:jobs] << {
|
36
36
|
url: url,
|
37
37
|
title: title,
|
38
|
-
|
38
|
+
content: content,
|
39
39
|
scope: "China",
|
40
40
|
job_type: "developer",
|
41
41
|
}
|
@@ -20,7 +20,7 @@ module CatClaw
|
|
20
20
|
|
21
21
|
private
|
22
22
|
def whisper sub_url, jt
|
23
|
-
puts 'opening URI ... '
|
23
|
+
puts 'opening URI ... weworkremotely '
|
24
24
|
url = @base_url + sub_url
|
25
25
|
doc = Nokogiri::HTML(open(url))
|
26
26
|
topics = doc.css("article ul li a")
|
@@ -33,7 +33,7 @@ module CatClaw
|
|
33
33
|
@footprint[:jobs] << {
|
34
34
|
url: url,
|
35
35
|
title: title,
|
36
|
-
|
36
|
+
content: content,
|
37
37
|
scope: "World",
|
38
38
|
job_type: jt,
|
39
39
|
}
|
data/lib/cat_claw/version.rb
CHANGED