音泉用の設定ファイル

今まで作ったプラグインを組み合わせて、音泉ページ (http://www.onsen.ag/)
から RSS を作成する Pragger 用の設定ファイル。


だけれども、やっぱり先に作っていた人がいた。おまけにアニメイトTV Webラジオ
の設定もありました。

暴満館 Pragger用プラグイン 音泉から各番組の放送を取得する



僕は、アニメイトTV のページの番組ごとに仕様が若干
異なるから、放置していたのだけれども。

# vim: set expandtab ts=4 sts=2 sw=2 tw=0 ft=pra syntax=yaml:

- module: Global::load_plugin
  config:
    path:
      - /home/develop/trunk/ruby/pragger/plugin

- module: Global::load_path
  config:
    path:
      - /home/opt/pragger/lib

- module: const_list
  config:
    - http://www.onsen.ag/

- module: Filter::http_cache
  config:
    cache: /home/opt/pragger/cache

- module: Filter::extract_html
  config:
    feed:
      xpath: //td[@bgcolor=#000000]
    item:
      title:
        regexp: <td width="135"[^>]?>(?:(?:<.+?>)*)\s*(.+?)\s*(?:<.+?>)
      link:
        regexp: (http://[^\s]+?\.asx)
      date:
        regexp: (http://[^\s]+?\.asx)
      category:
        regexp: <img height="11" alt="(.+?)!"
      description:
        regexp: <td align="center"><img .+?alt="([^"]+)"
    after_hook: |
        next if item['title'].nil? || item['link'].nil?
        item['description'] = "#{item['title']} #{item['description']}"
        item['category'] = "" if item['category'].nil?
        # 年が変わった場合は考慮していない
        if item['date'] =~ /([0-9]{2}[0-9]{2}).asx/
          item['date'] = Time.parse($1)
        else
          item['date'] = Time.now
        end

- module: Filter::inline_ruby
  config:
    source: |
      return data.sort {|a, b|
        b.date <=> a.date
      }

- module: RSS::save
  config:
    filename: /home/rss/onsen.xml