# -*- coding: utf-8 -*- require 'consadole_aggregator/nikkan_sports' require 'consadole_aggregator/live' if RUBY_VERSION < '1.9' # strptime は1.9 features なので、1.8 対応のモンキーパッチ class Time def Time.strptime(base, format) ary = base.split(/[^\d]/).delete_if{ |x| x.empty? } case ary.size when 3 Time.mktime(Time.now.year, Time.now.month, ary[0], ary[1], ary[2], 0, 0) when 5 Time.mktime(ary[0], ary[1], ary[2], ary[3], ary[4], 0, 0) else Time.now end end end end module ConsadoleAggregator Image = Struct.new :src, :alt do def to_html %Q{#{self.alt}} end end end if __FILE__ == $0 DataMapper.setup(:default, 'sqlite3:db/test.sqlite3') DataMapper.auto_migrate! ConsadoleAggregator::NikkanSports.save print ConsadoleAggregator::NikkanSports.rss end