Add Jekyll::WordPress.TABLE_PREFIX and inclusion in QUERY
This commit is contained in:
parent
13df722073
commit
42f63f919f
|
@ -11,12 +11,14 @@ require 'yaml'
|
||||||
|
|
||||||
module Jekyll
|
module Jekyll
|
||||||
module WordPress
|
module WordPress
|
||||||
|
|
||||||
|
TABLE_PREFIX = 'wp_xh2g8g_'
|
||||||
|
|
||||||
# Reads a MySQL database via Sequel and creates a post file for each
|
# Reads a MySQL database via Sequel and creates a post file for each
|
||||||
# post in wp_posts that has post_status = 'publish'.
|
# post in wp_posts that has post_status = 'publish'.
|
||||||
# This restriction is made because 'draft' posts are not guaranteed to
|
# This restriction is made because 'draft' posts are not guaranteed to
|
||||||
# have valid dates.
|
# have valid dates.
|
||||||
QUERY = "select post_title, post_name, post_date, post_content, post_excerpt, ID, guid from wp_posts where post_status = 'publish' and post_type = 'post'"
|
QUERY = "select post_title, post_name, post_date, post_content, post_excerpt, ID, guid from #{TABLE_PREFIX}posts where post_status = 'publish' and post_type = 'post'"
|
||||||
|
|
||||||
def self.process(dbname, user, pass, host = 'localhost')
|
def self.process(dbname, user, pass, host = 'localhost')
|
||||||
db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host, :encoding => 'utf8')
|
db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host, :encoding => 'utf8')
|
||||||
|
|
Loading…
Reference in New Issue