examples/newsindexer.rb in muddyit_fu-0.2.8 vs examples/newsindexer.rb in muddyit_fu-0.2.9

- old
+ new

@@ -4,19 +4,19 @@ require 'rss' require 'open-uri' # Connect to Muddy muddyit = Muddyit.new('./config.yml') -site = muddyit.sites.find(:all).first +collection= muddyit.collections.find(:all).first # Parse RSS rss_content = '' open('http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/uk_politics/rss.xml') do |f| rss_content = f.read end rss = RSS::Parser.parse(rss_content, false) # Loop through, analyse and display entities rss.items.each do |item| - page = site.pages.create({:uri => item.guid.content}, {:realtime => true, :store => false}) + page = collection.pages.create({:uri => item.guid.content}, {:realtime => true, :store => false}) puts "#{item.guid.content} contains:" page.entities.each do |entity| puts "\t#{entity.term}, #{entity.classification}" end end