Class: Panchira::MelonbooksResolver

Inherits:
Resolver
  • Object
show all
Defined in:
lib/panchira/resolvers/melonbooks_resolver.rb

Constant Summary collapse

URL_REGEXP =
/melonbooks.co.jp\/detail\/detail.php\?product_id=(\d+)/.freeze

Instance Method Summary collapse

Methods inherited from Resolver

applicable?, #initialize

Constructor Details

This class inherits a constructor from Panchira::Resolver

Instance Method Details

#fetchObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/panchira/resolvers/melonbooks_resolver.rb', line 7

def fetch
  result = PanchiraResult.new

  @page = fetch_page(@url)
  result.canonical_url = parse_canonical_url

  @page = fetch_page(result.canonical_url) if @url != result.canonical_url

  result.title = parse_title
  result.author, result.circle = parse_table
  result.description = parse_description
  result.image = parse_image
  result.resolver = parse_resolver
  result.tags = parse_tags

  result
end