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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f0171c41f0ababcc470bfe202804520e196f85f
4
- data.tar.gz: a2db564c533f0f21b344fe2afacc028a52cff9ee
3
+ metadata.gz: 93e8012f94dc1aace75dc27ad7bbee3c2e4aeaa8
4
+ data.tar.gz: c7658ac2adffe39092a9790008a8df4503dea1da
5
5
  SHA512:
6
- metadata.gz: 9a20a9e86ea4f4f909666dfd83dacc9d9752b68dae30dbbc83628ebe38c11473feacba2125d949bff4b727300ce7a952bda291615456a872751cc636880255fe
7
- data.tar.gz: fdd347e428c0bacf71688f867947557f94190bc92b139d5d6f3bf51d0e131d8ffa22cd58739128dbe1b506404b0dcefdebd72a19f3423aabe864c1938e4f409a
6
+ metadata.gz: efbdee35a85a888ce05e5191c09f6c72310997c2e1e0c9f742f0755b83911a61a93d4284d109e590e0ae99840e1af45d1012598b8e9d3abdc5b850a90f7457be
7
+ data.tar.gz: 5986115cf23503e94d270e6527c134603e6ffaba770f69abd5dacb05a0f35fc615321d01d5e10a5a74fb0c612c0831fd575e7d85360ada5c6078db2689c1c8e3
data/bin/catclaw CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require File.dirname(__FILE__) + '/../lib/cat_claw'
4
- runner = CatClaw::Catcher.new(ARGV)
5
- bp = runner.run
4
+ CatClaw.catch
@@ -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(arguments)
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
- parse_options
19
+ footprints = []
17
20
  @cats.each do |cat|
18
- p cat.paw
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
- description: content,
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
- description: content,
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
- description: content,
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
- description: content,
36
+ content: content,
37
37
  scope: "World",
38
38
  job_type: jt,
39
39
  }
@@ -1,3 +1,3 @@
1
1
  module CatClaw
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cat_claw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - yeer