Method: LearnableNotifier#find_next_message

Defined in:
lib/learnable-notifier.rb

#find_next_messageObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/learnable-notifier.rb', line 28

def find_next_message
  next_guid = nil
  feed = Feedzirra::Feed.fetch_and_parse("#{rss_path}?type=rss")
  feed.entries.each do |entry|
    unless self.sent[self.rss_path].include?(entry.entry_id)
      send_message("Message from Learnable", entry.title) 
      self.sent[self.rss_path].push(entry.entry_id)
    end
  end
  
  File.open(self.options[:storage], 'w') do |fh|
    YAML.dump(self.sent, fh)
  end
end