def parse(page)
if page.body =~ /<strong.*?>#{@video_id}<\/strong> を登録している公開マイリストはありません。/
@not_found = true
raise NotFound
end
@total_size = page.search('//div[@class="mb8p4"]//p[@class="TXT12"]//strong').first.inner_html.sub(/,/,'').to_i
@has_next = false
@has_prev = false
respages = page/'//div[@class="pagelink"]'
puts_info respages.size
respages.each {|r| puts_info r.inner_html }
if respages.size > 0
respages.each {|text|
if text.inner_html =~ /<a class="prevpage".*?>.*?戻る.*?<\/a>/
@has_prev = true
end
if text.inner_html =~ /<a class="nextpage".*?>.*?進む.*?<\/a>/
@has_next = true
end
}
end
scanpattern = /<a href=\"#{BASE_URL}\/mylist\/(\d+)\">(.+?)<\/a>/ou
listrefs = page.parser.to_html.scan(scanpattern)
@mylists = listrefs.inject([]) {|arr, v|
ml = MyList.new(@agent, v[0])
ml.title = v[1]
arr << ml
}
end