• R/O
  • HTTP
  • SSH
  • HTTPS

ArcGET: Commit

ArcGETのソースコード


Commit MetaInfo

Revision7fe9490c636e47251014ecfc87c7dc6fa6aa0ffc (tree)
Time2014-04-09 02:53:11
Authormikari <mikari@wolf...>
Commitermikari

Log Message

不要なコメント削除

Change Summary

Incremental Difference

--- a/lib/arcget.rb
+++ b/lib/arcget.rb
@@ -47,7 +47,7 @@ class ArcGET
4747 @sleepTime = 20.0
4848 @commitCount = 16
4949 @savePath = if param[:path] then param[:path] else "./save" end
50- @saveDB = if param[:db] then param[:db] else "./url.db3" end
50+ @saveDB = if param[:db] then param[:db] else "./url.db3" end
5151 @pendingURI = param[:pendingURI]
5252 @pendingURI = nil if @pendingURI.to_s == ""
5353 @list = URLtable.new(param={:path => @savePath, :db => @saveDB})
@@ -177,10 +177,7 @@ class ArcGET
177177 end
178178
179179 def check_root(add)
180- #p add.url.to_s
181- #p add.referrer.to_s
182180 @rootExp.each do |exp|
183- # p exp
184181 return true if exp.match(add.url.to_s)
185182 return true if exp.match(add.referrer.to_s)
186183 end
@@ -201,15 +198,11 @@ class ArcGET
201198 def add_nextpage_sub(path, dat)
202199 return unless path
203200
204- #p path
205201 path = CGI::unescapeHTML(path.to_s)
206202 return if /^(?:javascript|mailto|data|file|tel):/ni.match(path)
207- #p "##"
208203 uri = dat.uri
209204 begin
210- # p path
211205 path = URI.parse( path.gsub(/[\x00-\x1F\x80-\xFF]/n){|x| '%'+x.unpack('H2')[0] } )
212- # p path
213206 rescue URI::InvalidURIError, URI::InvalidComponentError
214207 # p "INV #{path}"
215208 return
@@ -224,15 +217,11 @@ class ArcGET
224217 if check_cgiroot(add) then
225218 add.linkCountCGI = dat.linkCountCGI+1
226219 end
227- ##add.message = path #for debug
228220
229- #p "L #{newuri} #{add.linkCount}:#{add.linkCountCGI}"
230221 return if add.linkCountCGI > @cgiMAXlink
231222
232223 isroot = check_root(add)
233- #p isroot
234224 if isroot and (add.linkCount <= @rootMAXlink) then
235- # p "U"
236225 if @rootExp[0].match(add.url) or (@cgirootExp[0] and @cgirootExp[0].match(add.url)) then
237226 add.priority = add.priority | 0x40000000
238227 end
@@ -244,31 +233,9 @@ class ArcGET
244233 }
245234 end
246235 end
247- #p path
248236 end
249237
250238 def add_nextpage(dat,response)
251-=begin
252- text = response.body
253- #p text
254- scriptmode = false
255- exp = /(<script|<\/script)\b|\b(?:href|src)(?:\s*=\s*"([^\x22]*)"|=([^\x22\x27> ]+))|\burl\(([^\x29]*)\)/ni
256- text.scan( exp ) do |t|
257- curr=t.shift
258- if curr=='<script'
259- scriptmode = true
260- end
261- if curr=='</script'
262- scriptmode = false
263- end
264-
265- if !scriptmode then
266- add_nextpage_sub(t[0], dat)
267- add_nextpage_sub(t[1], dat)
268- add_nextpage_sub(t[2], dat)
269- end
270- end
271-=end
272239 text = response.body
273240 scriptmode = false
274241 exp = /(<script|<\/script)\b|\b(href|src|value)(?:\s*=\s*"([^\x22]*)"|=([^\x22\x27> ]+))|\burl\(([^\x29]*)\)/ni
--- a/lib/downtable.rb
+++ b/lib/downtable.rb
@@ -5,9 +5,6 @@ require 'fileutils'
55 require 'uri'
66 require 'pathname'
77
8-#TABLE_PATH = "./url.db3"
9-
10-
118
129 class URLtable
1310 Waiting = 0
@@ -345,10 +342,6 @@ SQL
345342 read_sub(cond,data)
346343 )
347344 end
348-# sql = SELECT_SQLBODY
349-# sql += ' order by priority desc limit 1;'
350-# result = @db.query( sql, [] )
351-# return notNil( toRow(result) )
352345 end
353346
354347 def rest
Show on old repository browser