Permalink
Browse files

Added more comments, and a more helpful doc.

  • Loading branch information...
1 parent af0ffc5 commit 235511fb3ebc9aa209f3284deeedee89f80a8a32 @swenson committed Nov 23, 2008
Showing with 12 additions and 1 deletion.
  1. +5 −1 README
  2. +7 −0 import.rb
View
6 README
@@ -1,6 +1,10 @@
+This is a small project designed to take Wordpress entries and import them into Scanty. All that is needed is Scanty and an exported XML file from your Wordpress blog.
+
'import.rb' takes a command-line argument: the XML file to be imported into Scanty.
-It uses the default sqlite3 database at 'blog.db'
+Scanty currently only supports posts. It does not support drafts, pages, or comments natively. In order to preserve your comments, I'd recommend installing the Disqus plugin for Wordpress and exporting all of your comments to it.
+
+It uses the default sqlite3 database at 'blog.db'. Modify import.rb to change this to your approriate database, though I would recommend trying it out on a small sqlite3 database before using it on your live code.
Written by Christopher Swenson (http://www.caswenson.com/)
View
@@ -2,9 +2,15 @@
require 'rexml/document'
require 'time'
require 'sequel'
+
+# Change this to load the DB for your blog
DB = Sequel.connect('sqlite://blog.db')
+
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/lib')
require 'post'
+
+# This allows us to overwrite the primary key, so that you
+# can keep the same links for your comments
Post.unrestrict_primary_key
if ARGV.length == 0
@@ -15,6 +21,7 @@
file = File.new(ARGV[0])
# we have to hack the XML file, unfortunately, since it isn't valid
+# at least, for Wordpress 2.6.2
file = file.read
file.sub!(/xmlns:wp="http:\/\/wordpress.org\/export\/1.0\/"/,
"xmlns:wp=\"http://wordpress.org/export/1.0/\"\nxmlns:excerpt=\"excerpt\"")

0 comments on commit 235511f

Please sign in to comment.