Class: WWW::VideoScraper::AgeSage

Inherits:
Base
  • Object
show all
Defined in:
lib/www/video_scraper/age_sage.rb

Instance Attribute Summary

Attributes inherited from Base

#embed_tag, #page_url, #thumb_url, #title, #video_url

Instance Method Summary collapse

Methods inherited from Base

#initialize, scrape, url_regex, valid_url?

Constructor Details

This class inherits a constructor from WWW::VideoScraper::Base

Instance Method Details

#scrapeObject

Raises:



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/www/video_scraper/age_sage.rb', line 10

def scrape
  @request_url = @page_url.sub('.html', '.xml')
  @response_body = http_get(@request_url)
  raise FileNotFound if @response_body.nil? or @response_body.empty?
  xdoc = Hpricot.XML(@response_body.toutf8)
  if movie = xdoc.at('/movie')
    @video_url = movie.at('/movieurl').inner_html
    @thumb_url = movie.at('/thumbnail').inner_html
    @title = movie.at('/title').inner_html
    mcd = @page_url.match(%r|agesage\.jp/contentsPage\.html\?mcd=([[:alnum:]]{16})|)[1]
    @embed_tag = "<script type=\"text/javascript\" src=\"http://adult.agesage.jp/js/past_uraui.js\"></script>\n<script type=\"text/javascript\">Purauifla(\"mcd=\#{mcd}\", 320, 275);</script>\n  HTML\n  end\nend\n"