Class: RSS_Check::LIRS_File

Inherits:
RSS_File show all
Defined in:
lib/rss_check.rb

Instance Method Summary collapse

Methods inherited from RSS_File

#check, #date_of, #initialize, #mtime, #read_content

Constructor Details

This class inherits a constructor from RSS_Check::RSS_File

Instance Method Details

#check_entriesObject



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/rss_check.rb', line 110

def check_entries
  et = @entry_time
  res = []
  CSV::Reader.parse(read_content){|row|
    last_detected = Time.at(row[2].data.to_i)
    if last_detected > @entry_time && row[1].data != row[2].data
      if last_detected > et
        et = last_detected
      end
      res << {
        :about => row[5].data,
        :title => row[6].data,
        :ccode => 'EUC-JP'
      }
    end
  }
  @entry_time = et
  res
end