Class: X2CH::Subject

Inherits:
Object
  • Object
show all
Defined in:
lib/x2ch.rb

Class Method Summary collapse

Class Method Details

.download(url) ⇒ Object



198
199
200
# File 'lib/x2ch.rb', line 198

def self.download(url)
  Agent.download(url)
end

.parse(url, subject) ⇒ Object



202
203
204
205
206
207
208
209
210
211
# File 'lib/x2ch.rb', line 202

def self.parse(url, subject)
  threads = []
  subject.each_line{|l|
    m = l.match(/^(\d+\.(?:dat|cgi))(?:<>|,)(.+)\((\d+)\)$/).to_a
    if m[0]
      threads << Thread.new(url, m[1], m[2], m[3].to_i)
    end
  }
  threads
end