document.write("<div class=\"pastie\">\n");
document.write("  <link href=\"http://pastie.org/stylesheets/embed.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />\n");
document.write("  <link href=\"http://pastie.org/stylesheets/clean.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />\n");
document.write("  \n");
document.write("\n");
document.write("  \n");
document.write("  \n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("	\n");
document.write("	<div class=\"allcode\">\n");
document.write("		<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n");
document.write("		<tr>\n");
document.write("			<td>\n");
document.write("				\n");
document.write("				<pre class=\"textmate-source-numbers\">1\n");
document.write("2\n");
document.write("3\n");
document.write("4\n");
document.write("5\n");
document.write("6\n");
document.write("7\n");
document.write("8\n");
document.write("9\n");
document.write("10\n");
document.write("11\n");
document.write("12\n");
document.write("13\n");
document.write("14\n");
document.write("15\n");
document.write("16\n");
document.write("17\n");
document.write("18\n");
document.write("19\n");
document.write("20\n");
document.write("21\n");
document.write("22\n");
document.write("23\n");
document.write("24\n");
document.write("25\n");
document.write("26\n");
document.write("27\n");
document.write("28\n");
document.write("29\n");
document.write("30\n");
document.write("31\n");
document.write("32\n");
document.write("33\n");
document.write("34\n");
document.write("35\n");
document.write("36\n");
document.write("37\n");
document.write("38\n");
document.write("39\n");
document.write("40\n");
document.write("41\n");
document.write("42\n");
document.write("43\n");
document.write("44\n");
document.write("45\n");
document.write("46\n");
document.write("47\n");
document.write("48\n");
document.write("49\n");
document.write("50\n");
document.write("51\n");
document.write("52\n");
document.write("53\n");
document.write("54\n");
document.write("55\n");
document.write("56\n");
document.write("57\n");
document.write("<\/pre>\n");
document.write("			<\/td>\n");
document.write("		<td>\n");
document.write("		<pre class=\"textmate-source\"><pre class=\"sunburst\"><span class=\'comment comment_line comment_line_number-sign comment_line_number-sign_ruby\'>#!/usr/bin/env ruby<\/span>\n");
document.write("\n");
document.write("<span class=\'meta meta_require meta_require_ruby\'><span class=\'keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby\'>require<\/span> <span class=\'string string_quoted string_quoted_double string_quoted_double_ruby\'>&quot;data_mapper&quot;<\/span><\/span>\n");
document.write("<span class=\'meta meta_require meta_require_ruby\'><span class=\'keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby\'>require<\/span> <span class=\'string string_quoted string_quoted_double string_quoted_double_ruby\'>&quot;rexml/document&quot;<\/span><\/span>\n");
document.write("<span class=\'comment comment_line comment_line_number-sign comment_line_number-sign_ruby\'>#require &quot;RedCloth&quot;<\/span>\n");
document.write("<span class=\'keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby\'>include<\/span> <span class=\'variable variable_other variable_other_constant variable_other_constant_ruby\'>REXML<\/span>\n");
document.write("\n");
document.write("<span class=\'support support_class support_class_ruby\'>DataMapper<\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_with-arguments meta_function-call_method_with-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>setup<\/span><\/span>(<span class=\'constant constant_other constant_other_symbol constant_other_symbol_ruby\'>:default<\/span>, <span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'sqlite3:///home/angelbob/ruby/blog_repost/blog.db\'<\/span>)\n");
document.write("<span class=\'comment comment_line comment_line_number-sign comment_line_number-sign_ruby\'>#DataMapper.setup(:default, \'mysql://user:password@localhost/dbname\')<\/span>\n");
document.write("\n");
document.write("<span class=\'meta meta_class meta_class_ruby\'><span class=\'keyword keyword_control keyword_control_class keyword_control_class_ruby\'>class<\/span> <span class=\'entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby\'>Post<\/span><\/span>\n");
document.write("  <span class=\'keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby\'>include<\/span> <span class=\'support support_class support_class_ruby\'>DataMapper<\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>::<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>Resource<\/span><\/span>\n");
document.write("\n");
document.write("  property <span class=\'constant constant_other constant_other_symbol constant_other_symbol_ruby\'>:id<\/span>, <span class=\'variable variable_other variable_other_constant variable_other_constant_ruby\'>Serial<\/span>\n");
document.write("  property <span class=\'constant constant_other constant_other_symbol constant_other_symbol_ruby\'>:title<\/span>, <span class=\'variable variable_other variable_other_constant variable_other_constant_ruby\'>String<\/span>, <span class=\'constant constant_other constant_other_symbol constant_other_symbol_ruby\'>:length<\/span> =&gt; <span class=\'constant constant_numeric constant_numeric_ruby\'>255<\/span>\n");
document.write("  property <span class=\'constant constant_other constant_other_symbol constant_other_symbol_ruby\'>:body<\/span>, <span class=\'variable variable_other variable_other_constant variable_other_constant_ruby\'>Text<\/span>\n");
document.write("  property <span class=\'constant constant_other constant_other_symbol constant_other_symbol_ruby\'>:created_at<\/span>, <span class=\'variable variable_other variable_other_constant variable_other_constant_ruby\'>DateTime<\/span>\n");
document.write("  property <span class=\'constant constant_other constant_other_symbol constant_other_symbol_ruby\'>:updated_at<\/span>, <span class=\'variable variable_other variable_other_constant variable_other_constant_ruby\'>DateTime<\/span>\n");
document.write("<span class=\'keyword keyword_control keyword_control_ruby\'>end<\/span> <span class=\'comment comment_line comment_line_number-sign comment_line_number-sign_ruby\'># class Post<\/span>\n");
document.write("\n");
document.write("\n");
document.write("doc <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> <span class=\'support support_class support_class_ruby\'>Document<\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>new<\/span><\/span> <span class=\'support support_class support_class_ruby\'>File<\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_with-arguments meta_function-call_method_with-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>new<\/span><\/span>(<span class=\'string string_quoted string_quoted_double string_quoted_double_ruby\'>&quot;blog.xml&quot;<\/span>)\n");
document.write("doc<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>elements<\/span><\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_with-arguments meta_function-call_method_with-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>each<\/span><\/span>(<span class=\'string string_quoted string_quoted_double string_quoted_double_ruby\'>&quot;rss/channel/item&quot;<\/span>) {<span class=\'meta meta_syntax meta_syntax_ruby meta_syntax_ruby_start-block\'> <\/span>|<span class=\'variable variable_other variable_other_block variable_other_block_ruby\'>element<\/span>|\n");
document.write("  titleHTML <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> element<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>elements<\/span><\/span>[<span class=\'string string_quoted string_quoted_double string_quoted_double_ruby\'>&quot;title&quot;<\/span>]<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>to_s<\/span><\/span>\n");
document.write("  titleHTML<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>sub!<\/span><\/span> <span class=\'string string_regexp string_regexp_classic string_regexp_classic_ruby\'>/<\/span><span class=\'string string_regexp string_regexp_classic string_regexp_classic_ruby\'>^<span class=\'constant constant_character constant_character_escape constant_character_escape_ruby\'>\\&lt;<\/span>title<span class=\'constant constant_character constant_character_escape constant_character_escape_ruby\'>\\&gt;<\/span><span class=\'string string_regexp string_regexp_group string_regexp_group_ruby\'>(.*)<\/span><span class=\'constant constant_character constant_character_escape constant_character_escape_ruby\'>\\&lt;<\/span><span class=\'constant constant_character constant_character_escape constant_character_escape_ruby\'>\\/<\/span>title<span class=\'constant constant_character constant_character_escape constant_character_escape_ruby\'>\\&gt;<\/span>$<\/span><span class=\'string string_regexp string_regexp_classic string_regexp_classic_ruby\'>/<\/span>, <span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'\\1\'<\/span>\n");
document.write("\n");
document.write("  bodyElt <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> element<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>elements<\/span><\/span>[<span class=\'string string_quoted string_quoted_double string_quoted_double_ruby\'>&quot;content:encoded&quot;<\/span>]<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>to_s<\/span><\/span>\n");
document.write("  bodyre1 <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> <span class=\'support support_class support_class_ruby\'>Regexp<\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_with-arguments meta_function-call_method_with-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>new<\/span><\/span>(<span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'^&lt;content:encoded&gt;(.*)&lt;/content:encoded&gt;$\'<\/span>,\n");
document.write("                <span class=\'support support_class support_class_ruby\'>Regexp<\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>::<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>MULTILINE<\/span><\/span>)\n");
document.write("  bodyre2 <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> <span class=\'support support_class support_class_ruby\'>Regexp<\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_with-arguments meta_function-call_method_with-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>new<\/span><\/span>(<span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'&lt;!\\[CDATA\\[(.*)\\]\\]&gt;\'<\/span>, <span class=\'support support_class support_class_ruby\'>Regexp<\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>::<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>MULTILINE<\/span><\/span>)\n");
document.write("  bodyElt<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>sub!<\/span><\/span> bodyre1, <span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'\\1\'<\/span>\n");
document.write("  bodyElt<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>sub!<\/span><\/span> bodyre2, <span class=\'string string_quoted string_quoted_single string_quoted_single_ruby\'>\'\\1\'<\/span>\n");
document.write("\n");
document.write("  bodyHTML <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> bodyElt\n");
document.write("<span class=\'comment comment_line comment_line_number-sign comment_line_number-sign_ruby\'>  #bodyHTML = RedCloth.new(bodyHTML).to_html<\/span>\n");
document.write("\n");
document.write("  createDate <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> element<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>elements<\/span><\/span>[<span class=\'string string_quoted string_quoted_double string_quoted_double_ruby\'>&quot;wp:post_date_gmt&quot;<\/span>]<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>text<\/span><\/span>\n");
document.write("  bodyHTML <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> <span class=\'string string_quoted string_quoted_double string_quoted_double_ruby\'>&quot;Imported from WordPress<span class=\'constant constant_character constant_character_escape constant_character_escape_ruby\'>\\n<\/span><span class=\'constant constant_character constant_character_escape constant_character_escape_ruby\'>\\n<\/span>&quot;<\/span> <span class=\'keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby\'>+<\/span>\n");
document.write("           <span class=\'string string_quoted string_quoted_double string_quoted_double_ruby\'>&quot;Originally posted on <span class=\'source source_ruby source_ruby_embedded source_ruby_embedded_source\'>#{createDate}<\/span><span class=\'constant constant_character constant_character_escape constant_character_escape_ruby\'>\\n<\/span><span class=\'constant constant_character constant_character_escape constant_character_escape_ruby\'>\\n<\/span>&quot;<\/span> <span class=\'keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby\'>+<\/span> bodyHTML\n");
document.write("\n");
document.write("  post <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> <span class=\'support support_class support_class_ruby\'>Post<\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>new<\/span><\/span>\n");
document.write("  post<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>attributes<\/span><\/span> <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby\'>=<\/span> {<span class=\'meta meta_syntax meta_syntax_ruby meta_syntax_ruby_start-block\'><\/span>\n");
document.write("    <span class=\'constant constant_other constant_other_symbol constant_other_symbol_ruby\'>:title<\/span> =&gt; titleHTML,\n");
document.write("    <span class=\'constant constant_other constant_other_symbol constant_other_symbol_ruby\'>:body<\/span> =&gt; bodyHTML,\n");
document.write("    <span class=\'constant constant_other constant_other_symbol constant_other_symbol_ruby\'>:created_at<\/span> =&gt; <span class=\'support support_class support_class_ruby\'>DateTime<\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_with-arguments meta_function-call_method_with-arguments_ruby\'>::<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>parse<\/span><\/span>(createDate),\n");
document.write("    <span class=\'constant constant_other constant_other_symbol constant_other_symbol_ruby\'>:updated_at<\/span> =&gt; <span class=\'support support_class support_class_ruby\'>DateTime<\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>now<\/span><\/span>\n");
document.write("  }\n");
document.write("\n");
document.write("  <span class=\'keyword keyword_control keyword_control_ruby\'>unless<\/span> (post<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>save<\/span><\/span>)\n");
document.write("    puts <span class=\'string string_quoted string_quoted_double string_quoted_double_ruby\'>&quot;Failed to save post <span class=\'source source_ruby source_ruby_embedded source_ruby_embedded_source\'>#{titleHTML}<\/span>!&quot;<\/span>\n");
document.write("    puts <span class=\'string string_quoted string_quoted_double string_quoted_double_ruby\'>&quot;* Errors:<span class=\'constant constant_character constant_character_escape constant_character_escape_ruby\'>\\n<\/span>&quot;<\/span>\n");
document.write("    post<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>errors<\/span><\/span><span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>each<\/span><\/span> <span class=\'keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block\'>do <\/span>|<span class=\'variable variable_other variable_other_block variable_other_block_ruby\'>e<\/span>|\n");
document.write("      puts <span class=\'string string_quoted string_quoted_double string_quoted_double_ruby\'>&quot;* &quot;<\/span> <span class=\'keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby\'>+<\/span> e<span class=\'meta meta_function-call meta_function-call_method meta_function-call_method_without-arguments meta_function-call_method_without-arguments_ruby\'>.<span class=\'entity entity_name entity_name_function entity_name_function_ruby\'>to_s<\/span><\/span>\n");
document.write("    <span class=\'keyword keyword_control keyword_control_ruby\'>end<\/span>\n");
document.write("    puts <span class=\'string string_quoted string_quoted_double string_quoted_double_ruby\'>&quot;*****<span class=\'constant constant_character constant_character_escape constant_character_escape_ruby\'>\\n<\/span>&quot;<\/span>\n");
document.write("  <span class=\'keyword keyword_control keyword_control_ruby\'>end<\/span>\n");
document.write("}\n");
document.write("<\/pre><\/pre>\n");
document.write("		<\/td>\n");
document.write("		<\/tr>\n");
document.write("		<\/table>\n");
document.write("	\n");
document.write("	<\/div>\n");
document.write("\n");
document.write("\n");
document.write("  \n");
document.write("  \n");
document.write("  <div class=\"credit\">\n");
document.write("    <div class=\"buttons\">\n");
document.write("      <a href=\"http://pastie.org/pastes/456371.txt\">\n");
document.write("      <img src=\"http://pastie.org/images/view.png\" height=\"20\" width=\"67\" /><\/a>\n");
document.write("    <\/div>\n");
document.write("  \n");
document.write("    <a href=\"http://pastie.org/456371\">Pastie #456371<\/a> linked directly from <a href=\"http://pastie.org/\">Pastie<\/a>.\n");
document.write("  <\/div><\/div>");

