Module: OpenDMM::Maker::Waap::Parser

Defined in:
lib/opendmm/makers/waap.rb

Class Method Summary collapse

Class Method Details

.parse(content) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/opendmm/makers/waap.rb', line 20

def self.parse(content)
  page_uri = content.request.last_uri
  html = Nokogiri::HTML(content)
  specs = Utils.hash_by_split(html.css('ul.title_shosai li.wkact_ser_maker02').map(&:text))
  return {
    actresses:       specs['出演者'].split,
    brand:           specs['ブランド'],
    code:            specs['品番'],
    cover_image:     html.at_css('ul#title_img_all li.title_img a')['href'],
    description:     html.css('div#title_cmt_all').text,
    directors:       specs['監督'].split,
    genres:          specs['ジャンル'].split,
    label:           specs['レーベル'],
    maker:           specs['メーカー'],
    movie_length:    specs['収録時間'],
    page:            page_uri.to_s,
    release_date:    specs['発売日'],
    sample_images:   html.css('ul.samplepicture_list li a').map { |a| a['href'] },
    series:          specs['シリーズ'],
    thumbnail_image: html.at_css('#title_img_all > li.title_img > a > img')['src'],
    title:           html.css('ul#pan_list li').last.text,
  }
end