diff options
| author | hukl <hukl@eight.local> | 2009-01-31 23:14:28 +0100 |
|---|---|---|
| committer | hukl <hukl@eight.local> | 2009-01-31 23:14:28 +0100 |
| commit | 8de27a58b5c401ecb324014bf9827b28f30d6044 (patch) | |
| tree | c3004923a292771f0504c5c35e9299a0406bedd5 /lib | |
| parent | a214a1516bacc45c0ec8975decec2421ebb2e580 (diff) | |
updated importer to notice titles and other stuff
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/update_importer.rb | 10 |
1 files changed, 7 insertions, 3 deletions
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 @@ | |||
| 1 | require 'rexml/document' | 1 | require 'rexml/document' |
| 2 | require 'iconv' | ||
| 2 | 3 | ||
| 3 | class UpdateImporter | 4 | class UpdateImporter |
| 4 | 5 | ||
| @@ -58,10 +59,11 @@ class UpdateImporter | |||
| 58 | node.move_to_child_of parent_node | 59 | node.move_to_child_of parent_node |
| 59 | end | 60 | end |
| 60 | 61 | ||
| 61 | create_node_for_page chaospage, node | 62 | create_node_for_page chaospage, node, date |
| 62 | end | 63 | end |
| 63 | 64 | ||
| 64 | def create_node_for_page chaospage, node | 65 | def create_node_for_page chaospage, node, date |
| 66 | |||
| 65 | xhtml = convert_chaospage_to_xhtml(chaospage) | 67 | xhtml = convert_chaospage_to_xhtml(chaospage) |
| 66 | 68 | ||
| 67 | body = "" | 69 | body = "" |
| @@ -77,7 +79,9 @@ class UpdateImporter | |||
| 77 | 79 | ||
| 78 | if node.pages.empty? | 80 | if node.pages.empty? |
| 79 | node.pages.create!( | 81 | node.pages.create!( |
| 80 | :body => body | 82 | :title => xhtml.elements['title'].get_text.to_s, |
| 83 | :body => body, | ||
| 84 | :published_at => date | ||
| 81 | ) | 85 | ) |
| 82 | end | 86 | end |
| 83 | end | 87 | end |
