From 8de27a58b5c401ecb324014bf9827b28f30d6044 Mon Sep 17 00:00:00 2001 From: hukl Date: Sat, 31 Jan 2009 23:14:28 +0100 Subject: updated importer to notice titles and other stuff --- lib/update_importer.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/update_importer.rb b/lib/update_importer.rb index 979501f..4d4e1d5 100644 --- a/lib/update_importer.rb +++ b/lib/update_importer.rb @@ -1,4 +1,5 @@ require 'rexml/document' +require 'iconv' class UpdateImporter @@ -58,10 +59,11 @@ class UpdateImporter node.move_to_child_of parent_node end - create_node_for_page chaospage, node + create_node_for_page chaospage, node, date end - def create_node_for_page chaospage, node + def create_node_for_page chaospage, node, date + xhtml = convert_chaospage_to_xhtml(chaospage) body = "" @@ -77,7 +79,9 @@ class UpdateImporter if node.pages.empty? node.pages.create!( - :body => body + :title => xhtml.elements['title'].get_text.to_s, + :body => body, + :published_at => date ) end end -- cgit v1.3