161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
# File 'lib/x2ch.rb', line 161
def self.parse(html)
bbs = Bbs.new
category = nil
html.each_line{|l|
cname = l.match(/<BR><BR><B>(.+?)<\/B><BR>/).to_a[1]
if cname
if IGNORE_CATEGORIES.include?(cname)
category = nil
else
category = Category.new(cname)
bbs.push(category)
end
next
end
next unless category
b = l.match(/<A HREF=(http:\/\/.*(?:\.2ch\.net|\.bbspink\.com).+\/)>(.+)<\/A>/).to_a
if b[0]
next if IGNORE_BOARDS.include?(b[2])
board = Board.new(b[1], b[2])
category.push(board)
end
}
bbs
end
|