Class: X2CH::Dat
- Inherits:
-
Object
- Object
- X2CH::Dat
- Defined in:
- lib/x2ch.rb
Class Method Summary collapse
Class Method Details
.download(url) ⇒ Object
168 169 170 |
# File 'lib/x2ch.rb', line 168 def self.download(url) Agent.download(url) end |
.parse(dat) ⇒ Object
172 173 174 175 176 177 178 179 180 181 |
# File 'lib/x2ch.rb', line 172 def self.parse(dat) posts = [] dat.each_line{|l| m = l.match(/^(.+?)<>(.*?)<>(.*?)<>(.+)<>.*$/).to_a if m[0] posts << Post.new(m[1], m[2], m[3], m[4]) end } posts end |