spidr_epg_gem 0.0.0 → 0.0.1

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzdmOTg4MGRhNTFkZDQwOGY4NGQ2ZjY2ZjExYjI3NzE4M2Y0NDVjOQ==
4
+ YjQ1NjIzN2NiMGVhMGQyMmFiZjNkYTJlMWI3NzdkNTg3NGViNmE1ZA==
5
5
  data.tar.gz: !binary |-
6
- YjY2Yjg4MTMxMTU5MDRiMDdiNzU5MTg1Yzc1ZmZkOGMzYTY4YTZkZA==
6
+ OGViODFmYmViMzAxMmVkMzU4NjVkNDU1MzE2Y2I1MzZiYzQ2NjA2Yw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Y2NkNTBkMjRkODk3NGY1MWJjZWZmYzcxNGU2Y2E0MTgyYWE0ZmFkODBmZjk5
10
- MDk0MjE2MGQ1ZDRlYWU1MGU4ZmFmOGM4ZDViYjlkNDFlOTlmMTIxNjM0NDVi
11
- YTViNjFmNzU5YmVkMThkNGZjMThhYjU1YzQ4MTI4OGJjMDU5ZDA=
9
+ Y2UxZDQ4ZGRiMTRiMTM4ZWE3M2FhNzczODY4OTg0YjJhYjUxOGIyZjZlZDFk
10
+ OTkxMjM4NWNmNTk0ZGQ1Y2E1ZTRkMTc0MGE4NmJlNThiZjExMjg1MjA2NjUy
11
+ MDY0NGZmMTNkNjZhOGQwZjViZTExMDhiNGUwNDMxMzdlYmUwYTk=
12
12
  data.tar.gz: !binary |-
13
- OTA0OWI4OGYwZDBkOWM4ZjFlYmU1YzkyYWMwMzhjNjc1NTUxZDEyZTRkYjgy
14
- NjZjMTljNTYwYWNhZDNhMTNiYzhlMTU5NzY2ZmIzOGZhMDM1Zjc1YWE5MDJl
15
- ZGFjMmY2ZTY2Zjc0ODM5M2Y0MjM4NjI0YmIxN2Y1OWNjZDcxMzQ=
13
+ NTk5NmZmODVkOTRlZTc1MWY4YWMyNDUyY2UyNWJlOGVmNzQzOTliZjAwZTE3
14
+ Y2RkNzk2YTU0MDhiNzQ3M2FjYzBjNDViNTc0YzNiYjllMjcxZTU3ZjBhNzBl
15
+ NGVhNzMzOGI1MjVjZTU4NWFiN2U5YjZkMDRiMTk4ODU3ZGNhZjQ=
@@ -0,0 +1,8 @@
1
+ 关于配置配置文件的说明:
2
+
3
+ Spidr_config:
4
+ spidr_tvmao: #关于spidr的名称
5
+ spidr_url_config: #关于spidr_url的要求
6
+ include:[] #必须包含的
7
+ exclude: [] #需要排除的
8
+ regex: [] #正则匹配
@@ -11,6 +11,7 @@ require 'spidr/spidr'
11
11
  require 'openssl'
12
12
  require 'net/http'
13
13
  require 'set'
14
+ require 'yaml'
14
15
 
15
16
  module Spidr
16
17
  class Agent
@@ -20,6 +21,9 @@ module Spidr
20
21
  include Events
21
22
  include Actions
22
23
 
24
+ # Config with Spidr
25
+ attr_accessor :config_spidr
26
+
23
27
  # HTTP Host Header to use
24
28
  attr_accessor :host_header
25
29
 
@@ -121,6 +125,13 @@ module Spidr
121
125
  @host_headers.merge!(options[:host_headers])
122
126
  end
123
127
 
128
+ if options[:path_spidr_config]
129
+ path = options[:path_spidr_config]
130
+ self.config_spidr= YAML.load_file(path)
131
+ else
132
+ self.config_spidr= nil
133
+ end
134
+
124
135
  @user_agent = options.fetch(:user_agent,Spidr.user_agent)
125
136
  @referer = options[:referer]
126
137
 
@@ -487,8 +498,13 @@ module Spidr
487
498
  return false
488
499
  rescue Actions::Action
489
500
  end
490
-
491
- @queue << url
501
+ unless self.config_spidr
502
+ @queue << url
503
+ else
504
+ unless self.running?
505
+
506
+ end
507
+ end
492
508
  @levels[url] = level
493
509
  return true
494
510
  end
@@ -95,4 +95,6 @@ module Spidr
95
95
  def Spidr.site(url,options={},&block)
96
96
  Agent.site(url,options,&block)
97
97
  end
98
+
99
+
98
100
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.platform = Gem::Platform::RUBY
3
3
  s.name = 'spidr_epg_gem'
4
- s.version = '0.0.0'
4
+ s.version = '0.0.1'
5
5
  s.date = %q{2013-04-15}
6
6
  s.summary = 'Use for crwaling EPG'
7
7
  s.description = 'Use for crwaling EPG'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spidr_epg_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - zql
@@ -16,6 +16,7 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
+ - config_spidr_introductions
19
20
  - lib/spidr.rb
20
21
  - lib/spidr_epg.rb
21
22
  - lib/spidr_epg/actions.rb