アニメイト TV - Web ラジオ

アニメイトTV Web - 動画・音声

アニメイト TV の Web ラジオ配信サイトから、配信中のタイトル・日付・ラジオリンク・
説明を取得する。

class AnimateRadio < Rire::PropertyBase
  record :xpath => '//td[@bgcolor=#656363]' do
    has_property :title, :xpath => '//td[@class="main_title2"]'
    has_property :date, :xpath => '//td[@class="main_txt2"]'
    has_property :link, :regexp => '(http://[^\s]+?\.asx)'
    has_property :description, :xpath => '//'
  end

  after_hook do |entry|
    if entry.date =~ /([0-9]{4})([0-9]{1,2})([0-9]{1,2})日放送/
      entry.date = Time.parse("#{$1}/#{$2}/#{$3}")
    else
     entry.date = Time.now
    end

    entry
  end
end