list_spider 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/list_spider.rb +3 -21
- data/lib/list_spider/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a69a63919c971b077855f236631b5b91895e11836338c8970dec65214f92a4c
|
4
|
+
data.tar.gz: 6e0fefdd9a9eba8bfbead303bfbe2e27a0d98171bd60cdae89864f026289c987
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11a2591f94021e7bb3d06bb7a712f98cf8329142150cf09979d44cc65f1803c809e9077d85ad5d41c83457b20c2bf9694a3a65692898145eb7738e18460e40ba
|
7
|
+
data.tar.gz: 3e393c808733042ba3b13a950fcc63f7498641a55d16a5ccae11f3bf1100ca04558e32873bd9063602abd6c72194e8d90492b9b292e47cbd08bfc44476f5417f
|
data/Gemfile.lock
CHANGED
data/lib/list_spider.rb
CHANGED
@@ -126,7 +126,7 @@ module ListSpider
|
|
126
126
|
|
127
127
|
http_req.callback do
|
128
128
|
s = http_req.response_header.status
|
129
|
-
puts s
|
129
|
+
puts "#{Time.now}, http status code: #{s}"
|
130
130
|
|
131
131
|
if s == 200
|
132
132
|
local_dir = File.dirname(task_struct.local_path)
|
@@ -149,27 +149,9 @@ module ListSpider
|
|
149
149
|
end
|
150
150
|
|
151
151
|
http_req.errback do
|
152
|
-
puts "
|
153
|
-
puts task_struct.href
|
154
|
-
puts http_req.response_header.status
|
155
|
-
|
156
|
-
if task_struct.errback
|
157
|
-
task_struct.errback.call(task_struct, http_req)
|
158
|
-
# else
|
159
|
-
# ret = false
|
160
|
-
# if task_struct.http_method == :get
|
161
|
-
# ret = SpiderHelper.direct_http_get(task_struct.href, task_struct.local_path, convert_to_utf8: @convert_to_utf8)
|
162
|
-
# elsif task_struct.http_method == :post
|
163
|
-
# ret = SpiderHelper.direct_http_post(task_struct.href, task_struct.local_path, task_struct.params, convert_to_utf8: @convert_to_utf8)
|
164
|
-
# end
|
152
|
+
puts "#{Time.now}, #{task_struct.href}, error: #{http_req.error}"
|
165
153
|
|
166
|
-
|
167
|
-
# call_parse_method(task_struct)
|
168
|
-
# succeed_list << task_struct
|
169
|
-
# else
|
170
|
-
# failed_list << task_struct
|
171
|
-
# end
|
172
|
-
end
|
154
|
+
task_struct.errback.call(task_struct, http_req) if task_struct.errback
|
173
155
|
end
|
174
156
|
|
175
157
|
begin
|
data/lib/list_spider/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: list_spider
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Zhang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|