Skip to content

Instantly share code, notes, and snippets.

View mikong's full-sized avatar

Michael Galero mikong

  • Singapore
View GitHub Profile
@mikong
mikong / Importing posts from Wordpress into Jekyll.rb
Created September 5, 2011 12:24 — forked from vitobotta/Importing posts from Wordpress into Jekyll.rb
The script I used to import posts from my Wordpress blog into a new Jekyll one.
%w(rubygems sequel fileutils yaml active_support/inflector).each{|g| require g}
require File.join(File.dirname(__FILE__), "downmark_it")
module WordPress
def self.import(database, user, password, table_prefix = "wp_2", host = 'localhost')
db = Sequel.mysql(database, :user => user, :password => password, :host => host, :encoding => 'utf8')
FileUtils.mkdir_p "_posts"