Started integrationg the code into gem
* added nokogiri as dependency * added wordpress dump as fixture
This commit is contained in:
parent
b37abb4606
commit
dae4c2ea0a
|
@ -2,6 +2,7 @@ PATH
|
|||
remote: ./
|
||||
specs:
|
||||
refinerycms-wordpress-import (0.0.1)
|
||||
nokogiri (~> 1.4.4)
|
||||
refinerycms (~> 1.0.0)
|
||||
refinerycms-blog (~> 1.3.2)
|
||||
|
||||
|
@ -64,6 +65,7 @@ GEM
|
|||
mime-types (~> 1.16)
|
||||
treetop (~> 1.4.8)
|
||||
mime-types (1.16)
|
||||
nokogiri (1.4.4)
|
||||
orm_adapter (0.0.5)
|
||||
polyglot (0.3.1)
|
||||
rack (1.2.3)
|
||||
|
|
|
@ -9,4 +9,5 @@ Gem::Specification.new do |s|
|
|||
|
||||
s.add_dependency 'refinerycms', '~> 1.0.0'
|
||||
s.add_dependency 'refinerycms-blog', '~> 1.3.2'
|
||||
s.add_dependency 'nokogiri', '~> 1.4.4'
|
||||
end
|
||||
|
|
282
spec/fixtures/wordpress_dump.xml
vendored
Normal file
282
spec/fixtures/wordpress_dump.xml
vendored
Normal file
|
@ -0,0 +1,282 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
|
||||
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
|
||||
<!-- You may use this file to transfer that content from one site to another. -->
|
||||
<!-- This file is not intended to serve as a complete backup of your site. -->
|
||||
|
||||
<!-- To import this information into a WordPress site follow these steps: -->
|
||||
<!-- 1. Log in to that site as an administrator. -->
|
||||
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
|
||||
<!-- 3. Install the "WordPress" importer from the list. -->
|
||||
<!-- 4. Activate & Run Importer. -->
|
||||
<!-- 5. Upload this file using the form provided on that page. -->
|
||||
<!-- 6. You will first be asked to map the authors in this export file to users -->
|
||||
<!-- on the site. For each author, you may choose to map to an -->
|
||||
<!-- existing user on the site or to create a new user. -->
|
||||
<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
|
||||
<!-- contained in this file into your site. -->
|
||||
|
||||
<!-- generator="WordPress/3.1.2" created="2011-05-21 12:27" -->
|
||||
<rss version="2.0"
|
||||
xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/"
|
||||
xmlns:content="http://purl.org/rss/1.0/modules/content/"
|
||||
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:wp="http://wordpress.org/export/1.1/"
|
||||
>
|
||||
|
||||
<channel>
|
||||
<title>My test blog</title>
|
||||
<link>http://localhost/wordpress</link>
|
||||
<description>Just another WordPress site</description>
|
||||
<pubDate>Sat, 21 May 2011 12:27:19 +0000</pubDate>
|
||||
<language>en</language>
|
||||
<wp:wxr_version>1.1</wp:wxr_version>
|
||||
<wp:base_site_url>http://localhost/wordpress</wp:base_site_url>
|
||||
<wp:base_blog_url>http://localhost/wordpress</wp:base_blog_url>
|
||||
|
||||
<wp:author><wp:author_id>1</wp:author_id><wp:author_login>admin</wp:author_login><wp:author_email>admin@example.com</wp:author_email><wp:author_display_name><![CDATA[admin]]></wp:author_display_name><wp:author_first_name><![CDATA[]]></wp:author_first_name><wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author>
|
||||
|
||||
<wp:category><wp:term_id>7</wp:term_id><wp:category_nicename>rant</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Rant]]></wp:cat_name></wp:category>
|
||||
<wp:category><wp:term_id>3</wp:term_id><wp:category_nicename>tutorials</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Tutorials]]></wp:cat_name></wp:category>
|
||||
<wp:category><wp:term_id>1</wp:term_id><wp:category_nicename>uncategorized</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Uncategorized]]></wp:cat_name></wp:category>
|
||||
<wp:tag><wp:term_id>6</wp:term_id><wp:tag_slug>css</wp:tag_slug><wp:tag_name><![CDATA[css]]></wp:tag_name></wp:tag>
|
||||
<wp:tag><wp:term_id>5</wp:term_id><wp:tag_slug>html</wp:tag_slug><wp:tag_name><![CDATA[html]]></wp:tag_name></wp:tag>
|
||||
<wp:tag><wp:term_id>8</wp:term_id><wp:tag_slug>php</wp:tag_slug><wp:tag_name><![CDATA[php]]></wp:tag_name></wp:tag>
|
||||
<wp:tag><wp:term_id>4</wp:term_id><wp:tag_slug>ruby</wp:tag_slug><wp:tag_name><![CDATA[ruby]]></wp:tag_name></wp:tag>
|
||||
|
||||
<generator>http://wordpress.org/?v=3.1.2</generator>
|
||||
|
||||
<item>
|
||||
<title>Hello world!</title>
|
||||
<link>http://localhost/wordpress/?p=1</link>
|
||||
<pubDate>Sat, 21 May 2011 12:21:54 +0000</pubDate>
|
||||
<dc:creator>admin</dc:creator>
|
||||
<guid isPermaLink="false">http://localhost/wordpress/?p=1</guid>
|
||||
<description></description>
|
||||
<content:encoded><![CDATA[Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!]]></content:encoded>
|
||||
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
|
||||
<wp:post_id>1</wp:post_id>
|
||||
<wp:post_date>2011-05-21 12:21:54</wp:post_date>
|
||||
<wp:post_date_gmt>2011-05-21 12:21:54</wp:post_date_gmt>
|
||||
<wp:comment_status>open</wp:comment_status>
|
||||
<wp:ping_status>open</wp:ping_status>
|
||||
<wp:post_name>hello-world</wp:post_name>
|
||||
<wp:status>publish</wp:status>
|
||||
<wp:post_parent>0</wp:post_parent>
|
||||
<wp:menu_order>0</wp:menu_order>
|
||||
<wp:post_type>post</wp:post_type>
|
||||
<wp:post_password></wp:post_password>
|
||||
<wp:is_sticky>0</wp:is_sticky>
|
||||
<category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
|
||||
<wp:comment>
|
||||
<wp:comment_id>1</wp:comment_id>
|
||||
<wp:comment_author><![CDATA[Mr WordPress]]></wp:comment_author>
|
||||
<wp:comment_author_email></wp:comment_author_email>
|
||||
<wp:comment_author_url>http://wordpress.org/</wp:comment_author_url>
|
||||
<wp:comment_author_IP></wp:comment_author_IP>
|
||||
<wp:comment_date>2011-05-21 12:21:54</wp:comment_date>
|
||||
<wp:comment_date_gmt>2011-05-21 12:21:54</wp:comment_date_gmt>
|
||||
<wp:comment_content><![CDATA[Hi, this is a comment.<br />To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.]]></wp:comment_content>
|
||||
<wp:comment_approved>1</wp:comment_approved>
|
||||
<wp:comment_type></wp:comment_type>
|
||||
<wp:comment_parent>0</wp:comment_parent>
|
||||
<wp:comment_user_id>0</wp:comment_user_id>
|
||||
</wp:comment>
|
||||
</item>
|
||||
<item>
|
||||
<title>Sample Page</title>
|
||||
<link>http://localhost/wordpress/?page_id=2</link>
|
||||
<pubDate>Sat, 21 May 2011 12:21:54 +0000</pubDate>
|
||||
<dc:creator>admin</dc:creator>
|
||||
<guid isPermaLink="false">http://localhost/wordpress/?page_id=2</guid>
|
||||
<description></description>
|
||||
<content:encoded><![CDATA[This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:
|
||||
|
||||
<blockquote>Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my blog. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin' caught in the rain.)</blockquote>
|
||||
|
||||
...or something like this:
|
||||
|
||||
<blockquote>The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickies to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.</blockquote>
|
||||
|
||||
As a new WordPress user, you should go to <a href="http://localhost/wordpress/wp-admin/">your dashboard</a> to delete this page and create new pages for your content. Have fun!]]></content:encoded>
|
||||
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
|
||||
<wp:post_id>2</wp:post_id>
|
||||
<wp:post_date>2011-05-21 12:21:54</wp:post_date>
|
||||
<wp:post_date_gmt>2011-05-21 12:21:54</wp:post_date_gmt>
|
||||
<wp:comment_status>open</wp:comment_status>
|
||||
<wp:ping_status>open</wp:ping_status>
|
||||
<wp:post_name>sample-page</wp:post_name>
|
||||
<wp:status>publish</wp:status>
|
||||
<wp:post_parent>0</wp:post_parent>
|
||||
<wp:menu_order>0</wp:menu_order>
|
||||
<wp:post_type>page</wp:post_type>
|
||||
<wp:post_password></wp:post_password>
|
||||
<wp:is_sticky>0</wp:is_sticky>
|
||||
<wp:postmeta>
|
||||
<wp:meta_key>_wp_page_template</wp:meta_key>
|
||||
<wp:meta_value><![CDATA[default]]></wp:meta_value>
|
||||
</wp:postmeta>
|
||||
</item>
|
||||
<item>
|
||||
<title>Second blog post </title>
|
||||
<link>http://localhost/wordpress/?p=4</link>
|
||||
<pubDate>Sat, 21 May 2011 12:23:52 +0000</pubDate>
|
||||
<dc:creator>admin</dc:creator>
|
||||
<guid isPermaLink="false">http://localhost/wordpress/?p=4</guid>
|
||||
<description></description>
|
||||
<content:encoded><![CDATA[This is just a standard text page example. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin metus dolor, hendrerit sit amet, aliquet nec, posuere sed, purus. Nullam et velit iaculis odio sagittis placerat. Duis metus tellus, pellentesque ut, luctus id, egestas a, lorem. Praesent vitae mauris. Aliquam sed nulla. Sed id nunc vitae leo suscipit viverra. Proin at leo ut lacus consequat rhoncus.
|
||||
|
||||
In hac habitasse platea dictumst. Nunc quis tortor sed libero hendrerit dapibus. Integer interdum purus id erat. Duis nec velit vitae dolor mattis euismod. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse pellentesque dignissim lacus. Nulla semper euismod arcu. Suspendisse egestas, erat a consectetur dapibus, felis orci cursus eros, et sollicitudin purus urna et metus. Integer eget est sed nunc euismod vestibulum. Integer nulla dui, tristique in, euismod et, interdum imperdiet, enim. Mauris at lectus. Sed egestas tortor nec mi.]]></content:encoded>
|
||||
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
|
||||
<wp:post_id>4</wp:post_id>
|
||||
<wp:post_date>2011-05-21 12:23:52</wp:post_date>
|
||||
<wp:post_date_gmt>2011-05-21 12:23:52</wp:post_date_gmt>
|
||||
<wp:comment_status>open</wp:comment_status>
|
||||
<wp:ping_status>open</wp:ping_status>
|
||||
<wp:post_name>second-blog-post</wp:post_name>
|
||||
<wp:status>publish</wp:status>
|
||||
<wp:post_parent>0</wp:post_parent>
|
||||
<wp:menu_order>0</wp:menu_order>
|
||||
<wp:post_type>post</wp:post_type>
|
||||
<wp:post_password></wp:post_password>
|
||||
<wp:is_sticky>0</wp:is_sticky>
|
||||
<category domain="post_tag" nicename="css"><![CDATA[css]]></category>
|
||||
<category domain="post_tag" nicename="html"><![CDATA[html]]></category>
|
||||
<category domain="post_tag" nicename="ruby"><![CDATA[ruby]]></category>
|
||||
<category domain="category" nicename="tutorials"><![CDATA[Tutorials]]></category>
|
||||
<wp:postmeta>
|
||||
<wp:meta_key>_edit_last</wp:meta_key>
|
||||
<wp:meta_value><![CDATA[1]]></wp:meta_value>
|
||||
</wp:postmeta>
|
||||
</item>
|
||||
<item>
|
||||
<title>Third blog post</title>
|
||||
<link>http://localhost/wordpress/?p=6</link>
|
||||
<pubDate>Sat, 21 May 2011 12:24:45 +0000</pubDate>
|
||||
<dc:creator>admin</dc:creator>
|
||||
<guid isPermaLink="false">http://localhost/wordpress/?p=6</guid>
|
||||
<description></description>
|
||||
<content:encoded><![CDATA[This is just a standard text page example. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin metus dolor, hendrerit sit amet, aliquet nec, posuere sed, purus. Nullam et velit iaculis odio sagittis placerat. Duis metus tellus, pellentesque ut, luctus id, egestas a, lorem. Praesent vitae mauris. Aliquam sed nulla. Sed id nunc vitae leo suscipit viverra. Proin at leo ut lacus consequat rhoncus. In hac habitasse platea dictumst. Nunc quis tortor sed libero hendrerit dapibus.
|
||||
|
||||
Integer interdum purus id erat. Duis nec velit vitae dolor mattis euismod. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse pellentesque dignissim lacus.
|
||||
|
||||
Nulla semper euismod arcu. Suspendisse egestas, erat a consectetur dapibus, felis orci cursus eros, et sollicitudin purus urna et metus. Integer eget est sed nunc euismod vestibulum. Integer nulla dui, tristique in, euismod et, interdum imperdiet, enim. Mauris at lectus. Sed egestas tortor nec mi.]]></content:encoded>
|
||||
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
|
||||
<wp:post_id>6</wp:post_id>
|
||||
<wp:post_date>2011-05-21 12:24:45</wp:post_date>
|
||||
<wp:post_date_gmt>2011-05-21 12:24:45</wp:post_date_gmt>
|
||||
<wp:comment_status>open</wp:comment_status>
|
||||
<wp:ping_status>open</wp:ping_status>
|
||||
<wp:post_name>third-blog-post</wp:post_name>
|
||||
<wp:status>publish</wp:status>
|
||||
<wp:post_parent>0</wp:post_parent>
|
||||
<wp:menu_order>0</wp:menu_order>
|
||||
<wp:post_type>post</wp:post_type>
|
||||
<wp:post_password></wp:post_password>
|
||||
<wp:is_sticky>0</wp:is_sticky>
|
||||
<category domain="post_tag" nicename="css"><![CDATA[css]]></category>
|
||||
<category domain="post_tag" nicename="html"><![CDATA[html]]></category>
|
||||
<category domain="post_tag" nicename="php"><![CDATA[php]]></category>
|
||||
<category domain="category" nicename="rant"><![CDATA[Rant]]></category>
|
||||
<wp:postmeta>
|
||||
<wp:meta_key>_edit_last</wp:meta_key>
|
||||
<wp:meta_value><![CDATA[1]]></wp:meta_value>
|
||||
</wp:postmeta>
|
||||
<wp:comment>
|
||||
<wp:comment_id>2</wp:comment_id>
|
||||
<wp:comment_author><![CDATA[admin]]></wp:comment_author>
|
||||
<wp:comment_author_email>admin@example.com</wp:comment_author_email>
|
||||
<wp:comment_author_url></wp:comment_author_url>
|
||||
<wp:comment_author_IP>127.0.0.1</wp:comment_author_IP>
|
||||
<wp:comment_date>2011-05-21 12:26:24</wp:comment_date>
|
||||
<wp:comment_date_gmt>2011-05-21 12:26:24</wp:comment_date_gmt>
|
||||
<wp:comment_content><![CDATA[A comment]]></wp:comment_content>
|
||||
<wp:comment_approved>1</wp:comment_approved>
|
||||
<wp:comment_type></wp:comment_type>
|
||||
<wp:comment_parent>0</wp:comment_parent>
|
||||
<wp:comment_user_id>1</wp:comment_user_id>
|
||||
</wp:comment>
|
||||
<wp:comment>
|
||||
<wp:comment_id>3</wp:comment_id>
|
||||
<wp:comment_author><![CDATA[admin]]></wp:comment_author>
|
||||
<wp:comment_author_email>admin@example.com</wp:comment_author_email>
|
||||
<wp:comment_author_url>http://www.example.com/</wp:comment_author_url>
|
||||
<wp:comment_author_IP>127.0.0.1</wp:comment_author_IP>
|
||||
<wp:comment_date>2011-05-21 12:26:30</wp:comment_date>
|
||||
<wp:comment_date_gmt>2011-05-21 12:26:30</wp:comment_date_gmt>
|
||||
<wp:comment_content><![CDATA[Another one!]]></wp:comment_content>
|
||||
<wp:comment_approved>1</wp:comment_approved>
|
||||
<wp:comment_type></wp:comment_type>
|
||||
<wp:comment_parent>0</wp:comment_parent>
|
||||
<wp:comment_user_id>1</wp:comment_user_id>
|
||||
</wp:comment>
|
||||
</item>
|
||||
<item>
|
||||
<title>About</title>
|
||||
<link>http://localhost/wordpress/?page_id=8</link>
|
||||
<pubDate>Sat, 21 May 2011 12:25:13 +0000</pubDate>
|
||||
<dc:creator>admin</dc:creator>
|
||||
<guid isPermaLink="false">http://localhost/wordpress/?page_id=8</guid>
|
||||
<description></description>
|
||||
<content:encoded><![CDATA[This is just a standard text page example. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin metus dolor, hendrerit sit amet, aliquet nec, posuere sed, purus. Nullam et velit iaculis odio sagittis placerat. Duis metus tellus, pellentesque ut, luctus id, egestas a, lorem. Praesent vitae mauris. Aliquam sed nulla. Sed id nunc vitae leo suscipit viverra. Proin at leo ut lacus consequat rhoncus.
|
||||
|
||||
In hac habitasse platea dictumst. Nunc quis tortor sed libero hendrerit dapibus. Integer interdum purus id erat. Duis nec velit vitae dolor mattis euismod. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse pellentesque dignissim lacus. Nulla semper euismod arcu. Suspendisse egestas, erat a consectetur dapibus, felis orci cursus eros, et sollicitudin purus urna et metus. Integer eget est sed nunc euismod vestibulum. Integer nulla dui, tristique in, euismod et, interdum imperdiet, enim. Mauris at lectus. Sed egestas tortor nec mi.]]></content:encoded>
|
||||
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
|
||||
<wp:post_id>8</wp:post_id>
|
||||
<wp:post_date>2011-05-21 12:25:13</wp:post_date>
|
||||
<wp:post_date_gmt>2011-05-21 12:25:13</wp:post_date_gmt>
|
||||
<wp:comment_status>open</wp:comment_status>
|
||||
<wp:ping_status>open</wp:ping_status>
|
||||
<wp:post_name>about</wp:post_name>
|
||||
<wp:status>publish</wp:status>
|
||||
<wp:post_parent>0</wp:post_parent>
|
||||
<wp:menu_order>0</wp:menu_order>
|
||||
<wp:post_type>page</wp:post_type>
|
||||
<wp:post_password></wp:post_password>
|
||||
<wp:is_sticky>0</wp:is_sticky>
|
||||
<wp:postmeta>
|
||||
<wp:meta_key>_edit_last</wp:meta_key>
|
||||
<wp:meta_value><![CDATA[1]]></wp:meta_value>
|
||||
</wp:postmeta>
|
||||
<wp:postmeta>
|
||||
<wp:meta_key>_wp_page_template</wp:meta_key>
|
||||
<wp:meta_value><![CDATA[default]]></wp:meta_value>
|
||||
</wp:postmeta>
|
||||
</item>
|
||||
<item>
|
||||
<title>About me</title>
|
||||
<link>http://localhost/wordpress/?page_id=10</link>
|
||||
<pubDate>Sat, 21 May 2011 12:25:42 +0000</pubDate>
|
||||
<dc:creator>admin</dc:creator>
|
||||
<guid isPermaLink="false">http://localhost/wordpress/?page_id=10</guid>
|
||||
<description></description>
|
||||
<content:encoded><![CDATA[This is just a standard text page example. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin metus dolor, hendrerit sit amet, aliquet nec, posuere sed, purus. Nullam et velit iaculis odio sagittis placerat.
|
||||
|
||||
Duis metus tellus, pellentesque ut, luctus id, egestas a, lorem. Praesent vitae mauris. Aliquam sed nulla. Sed id nunc vitae leo suscipit <strong>viverra</strong>. Proin at leo ut lacus consequat rhoncus. In hac habitasse platea dictumst. Nunc quis tortor sed libero hendrerit dapibus. Integer interdum purus id erat. Duis nec velit vitae dolor mattis euismod.
|
||||
|
||||
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse pellentesque dignissim lacus. Nulla semper euismod arcu. Suspendisse egestas, erat a consectetur dapibus, felis orci cursus eros, et sollicitudin purus urna et metus. Integer eget est sed nunc euismod vestibulum. Integer nulla dui, tristique in, euismod et, interdum imperdiet, enim. Mauris at lectus. Sed egestas tortor nec mi.]]></content:encoded>
|
||||
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
|
||||
<wp:post_id>10</wp:post_id>
|
||||
<wp:post_date>2011-05-21 12:25:42</wp:post_date>
|
||||
<wp:post_date_gmt>2011-05-21 12:25:42</wp:post_date_gmt>
|
||||
<wp:comment_status>open</wp:comment_status>
|
||||
<wp:ping_status>open</wp:ping_status>
|
||||
<wp:post_name>about-me</wp:post_name>
|
||||
<wp:status>publish</wp:status>
|
||||
<wp:post_parent>8</wp:post_parent>
|
||||
<wp:menu_order>0</wp:menu_order>
|
||||
<wp:post_type>page</wp:post_type>
|
||||
<wp:post_password></wp:post_password>
|
||||
<wp:is_sticky>0</wp:is_sticky>
|
||||
<wp:postmeta>
|
||||
<wp:meta_key>_edit_last</wp:meta_key>
|
||||
<wp:meta_value><![CDATA[1]]></wp:meta_value>
|
||||
</wp:postmeta>
|
||||
<wp:postmeta>
|
||||
<wp:meta_key>_wp_page_template</wp:meta_key>
|
||||
<wp:meta_value><![CDATA[default]]></wp:meta_value>
|
||||
</wp:postmeta>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
Loading…
Reference in New Issue
Block a user