Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Migrate iWeb blog to WordPress Internet
I had to migrate my personal blog about my 2-year old daughter from MobileMe servers to a WordPress account. I wanted to keep all the comments, as well as my posts and other content. So I wrote a perl script to do the job. It is far from beeing perfect, but it works for me. You will have to change some settings in the script to get it to work for you.

Features:
  • Keep comments
  • Keep images (mostly)
  • Sets e-mail adresses for comments by name
  • Sets tags by text strings found in title or body


Note: The script will only work as long as Apple's servers are active (through June 30, 2012).

Tips: 1. Import to WordPress first without images. 2. Import the same file again with images. 3. If you can, adjust running time for scripts on your hosting service.

[kirkmc adds: I have no way of testing it, never having created a site with iWeb. Look carefully at the script and check for what variables you need to set. Obviously, there is no risk, as you'll simply be converting from your iWeb site to WordPress, but make sure you keep backups of everything anyway. It would be good if someone could post in the comments whether it works for them or not. Save the script as a .pl file before running it.]


#!/usr/bin/perl

use strict;
use warnings;                                                                   
use LWP;
my %VAR;	# Hash of Variables
my $version = '1.1';

# 1.
# Make sure that you don't have any image in your Wordpress Blog named shapeimage_*.png !
# We need to guess the filenames to generate the links
#
# 2. 
# Adjudst Paramter inline starting above
#
# 3.
# Run this script
# perl iweb2wordpress.pl 
# the export file is gnerated in current directory
#
# 4. 
# When importing, delete your Password (htaccess) from web.me.com. The Wordpress Importer needs to get your
# images.

# ================================================================================
# Adjust here

# ------------------------
# set to 1 if you need more info
my $debug = 1;
my $verbose = 1;

# ------------------------
# from to
# set to 0 for unlimited
my $start_id = 0;
my $end_id = 0;

# ------------------------
# old adress
my $blog_url = 'http://web.me.com/coreyhilz/Corey_Hilz/Photo_Blog/blog-archive.xml';
#my $blog_url = 'http://web.me.com/joelgrimes/Joel_Grimes_Photography/Blog/blog-archive.xml';

# ------------------------
# optional Basic Authentification .htaccess 
my $ht_username = '';
my $ht_password = '';
my $domain = 'web.me.com:80';
my $realm = 'me.com';

# ------------------------
# new adress
$VAR{'base_site_url'} = 'http://www.newdomain.com';
$VAR{'base_blog_url'} = 'http://www.newdomain.com';							# mostly the same as base_site_url
$VAR{'base_upload_url'} = 'http://www.newdomain.com/wp-content/uploads/';		# url to upload dir
$VAR{'author_login'} = 'Author';
$VAR{'author_display_name'} = 'Author';
$VAR{'author_email'} = 'noemail@internet.de';
$VAR{'author_first_name'} = 'First';
$VAR{'author_last_name'} = 'Last';
$VAR{'language'} = 'en';

# ------------------------
# category
my $golbal_category = "Allgemein";
my $golbal_category_nicename = "allgemein";


# ------------------------
# set comment_author emails
my %comment_author_email_adresses;
$comment_author_email_adresses{'Mirko'} = 'noemail@internet.de';
$comment_author_email_adresses{'Peter'} = 'peter@internet.de';


# -----------------------
# Define Tags by content or title
my %tags = ( "searchstring" , "Tag1",
           "searchstring2", "Tag2"
           );


# ------------------------
# Declaration of variables 

# Pattern to match the class name <p class"NAME">
# 
# You may have to adjust!
my $para_pattern = "paragraph_style_.*";
#my $para_pattern = "Body";

# Standard post time, since iweb does not provide it
my $standard_post_time = '12:00:00';

# Pattern of images that should not be migrated
my $exclude_img_pattern = "Welcome|Blog|height:\\s*\\d\\dpx";

# Month
#my %month = ("Januar"=>1, "Februar"=>2, "März"=>3, "April"=>4, "Mai"=>5, "Juni"=>6, "Juli"=>7, "August"=>8, "September"=>9, "Oktober"=>10, "November"=>11, "Dezember"=>12,);
my %month = ("January"=>1, "February"=>2, "March"=>3, "April"=>4, "May"=>5, "June"=>6, "July"=>7, "August"=>8, "September"=>9, "October"=>10, "November"=>11, "December"=>12,);

# ================================================================================
# Declaration of internal variables 
my $post_id=0;						# No of posts, adjust if you want to start with another value
my $comment_id=0;					# No of comments, adjust if you want to start with another value
my $post_count=0;					# No of Posts, not attachments
my $suffix = "?wsc=entry.js&ts=";	# Suffix for getting comments
my @posts; 							# Array of Posts
my %filename;						# Hash of filename 'shapeimage...'

# ------------------------
# internal
$VAR{'iWeb2Wordpress'} = 'iWeb2Wordpress ' . $version;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
# 2012-04-06 19:51
$VAR{'created'} = sprintf '%04d-%02d-%02d %02d:%02d', $year+1900, $mon+1, $mday, $hour, $min;
my $file_suffix = sprintf '%04d-%02d-%02d-%02d%02d%02d', $year+1900, $mon+1, $mday, $hour, $min, $sec;


# ================================================================================
# Let's go

# Create export
open(FILE, ">iweb2wordpress_$file_suffix.xml") || die "can't write file\n";

# ------------ Webbrowser
my $ua = LWP::UserAgent->new('Mozilla');        

# ------------ Login, if neccesary Basic Authentification .htaccess
$ua->credentials($domain, $realm, $ht_username, $ht_password);        

# ------------ Url of your Blog
my $res = $ua->get($blog_url); 
#print $res->content if $verbose;

# ------------ Find Blog title
#<channel>
#    <title>Lebensstart</title>
if ($res->content =~ /<channel>\n\s*<title>(.*?)<\/title>/g)  {
	$VAR{'title'} = $1;
} else {
	$VAR{'title'} = 'sorry, no title found, but you can adjust afterwards.';
}
print "title=$VAR{'title'}\n" if $debug;

# ------------ Find description
#    <description>Lebe Dein Leben</description>
if ($res->content =~ /<description>(.*?)<\/description>/g)  {
	$VAR{'description'} = $1;
} else {
	$VAR{'description'} = 'sorry, no description found, but you can adjust afterwards.';
}
print "description=$VAR{'description'}\n" if $debug;


# ------------ evualating header
my $header = &get_header();
while ($header =~ s/\$\$(.*?)\$\$/$VAR{$1}/g) {
	#print "subst $1=>$VAR{$1}\n";
}
print FILE $header;



# ------------ Find posts, this only works on web.me.com
@posts = ($res->content =~ m/<link>(http:\/\/web.me.com\/.*html)<\/link/g);
# ------------ Loop through posts
for my $url (@posts) {
		print "="x80 . "\n" if $verbose or $debug;
        print "processing $url\n" if $debug;
        
    	$VAR{'post_link'} = $url;
        $post_id++;
        $post_count++;
        $VAR{'post_id'} = $post_id;
        print "post_id=$VAR{'post_id'}\n" if $debug;
        
        last if ($end_id > 0 and $post_count > $end_id);
        next if ($start_id > 0 and $post_count < $start_id );
        
        my $base_url;
        if ($url =~ /(.*\/).*?/) {
        	$base_url = $1;
        }
        print "base_url=$base_url\n" if $debug;
        
        my $res = $ua->get($url);
        print "-"x80 . "\n" if $verbose;
        print $res->content if $verbose;
        print "-"x80 . "\n" if $verbose;
        
        
        # ------------ Find post title
		#    <title>Lebensstart</title>
		if ($res->content =~ /<title>(.*?)<\/title>/g)  {
			$VAR{'post_title'} = $1;
		} else {
			$VAR{'post_title'} = 'post_' . $post_id;
		}
		print "post_title=$VAR{'post_title'}\n" if $debug;
		
		# ------------ Find posting date 
		#    <meta name="iWeb-Build" content="local-build-20120329" />
		#
		#<wp:post_date>2011-08-14 18:21:30</wp:post_date>
		#<wp:post_date_gmt>2011-08-14 18:21:30</wp:post_date_gmt>
		#
		# via local_build
		
		if ($res->content =~ /<meta\s+name=\"iWeb-Build\"\s+content=\"local-build-(\d\d\d\d)(\d\d)(\d\d)\"\s+\/>/g)  {
			$VAR{'post_date'} = "$1-$2-$3 " . $standard_post_time;
			$VAR{'post_date_gmt'} = $VAR{'post_date'};
		} else {
			print "Posting Date not found $url\n";
			$VAR{'post_date'} = sprintf '%04d-%02d-%02d ' . $standard_post_time, $year+1900, $mon+1, $mday;
			$VAR{'post_date_gmt'} = $VAR{'post_date'};
		}
		print "post_date=$VAR{'post_date'}\n" if $debug;
		print "post_date_gmt=$VAR{'post_date_gmt'}\n" if $debug;
		
		# better class="Date"
		#
		#<p style="padding-bottom: 0pt; padding-top: 0pt; " class="Date">Sonntag, 25. März 2012</p>
		
		if ($res->content =~ /class="Date"\>.*?,\s*(\d*)\.\s+(.*?)\s+(\d*)\s*\</gi)  {
			#print $1 ."#" . $2 . "#". $3;
			$VAR{'post_date'} = sprintf '%04d-%02d-%02d ' . $standard_post_time, $3, $month{$2}, $1;
			$VAR{'post_date_gmt'} = $VAR{'post_date'};
		} 
		
		print "post_date=$VAR{'post_date'}\n" if $debug;
		print "post_date_gmt=$VAR{'post_date_gmt'}\n" if $debug;
		
		
		
		#<pubDate>Sun, 14 Aug 2011 18:21:30 +0000</pubDate>
		
		# ------------ Find GUID
		# "current-page-GUID": "8E8A3D79-7A0C-40D9-BCA8-EF1AE35C52DB"
		if ($res->content =~ /\"current-page-GUID\":\s*\"(.*?)\"/g)  {
			$VAR{'post_guid'} = $1;
		} else {
			$VAR{'post_guid'} = $url;
		}
		print "post_guid=$VAR{'post_guid'}\n" if $debug;
		
		
		# ------------ evualating content
		# maybe a readability API call would work much better
		my $last_link_or_para;
		my $attachment_post_id;
		my $post_paragraph = '';
		my $attachment_paragraph = '';
		my $attachment_id = 0;
		my @para = ($res->content =~ /<p.*?class="$para_pattern">(.*?)<\/p>|(<img.*?src=".*?png\".*?>)/g);
		foreach my $link_or_para (@para) {
 			if ($link_or_para) {
 				print "\n\n $link_or_para \n\n" if $verbose;
 				# ------------------------ complete url of images
 				$link_or_para =~ s/(<img.*?src=")(.*?png").*?/$1$base_url$2>/gim;
 				
 				# ------------------------ new filename to be unique
 				# .../2012/3/4_Tennishalle_files/shapeimage_1.png
				if ($link_or_para =~ m/(<img.*?src="(.*\/(.*?\/.*?\/.*?\/(.*?).png))".*?>)/g ) {
					my $img_url = $2;
					my $img_filename = $3;
					my $img_old_filename = $3;
					my $img_shortname = $4;
					my $img_all = $1;
					
					# Skip unwanted images
					next if $link_or_para =~ m/$exclude_img_pattern/;
					
					print "img_shortname=$img_shortname\n" if $debug;
					#print "filename=$img_shortname\n" if $debug;
					
					# Replace / with _
					$img_filename =~ s/\//_/g;
					
					#try to guess wordpress filename
					#
					# offen: Wenn img_Shortname 2 oder mehrstellig ist.
					# 10
					my $new_img_shortname = $img_shortname;
					
					my $suffix = '';
					my $no = 0;
					
					#while (defined($filename{$img_shortname . $suffix }) and ($filename{$img_shortname . $suffix } > 0)) {
					while ( defined($filename{$img_shortname . $suffix })) {
						$no++;
						$suffix = '' . $no;
					}
					$img_shortname = $img_shortname . $suffix;
					$filename{$img_shortname}++;
					

					
					$link_or_para =~ s/$img_old_filename/$img_shortname.png/gim;
					
					# http://marla.weinschenks.com/wp-content/uploads/2012/04/20120402-173939.jpg
					my $akt_upload_subdir = sprintf '%04d/%02d/', $year+1900, $mon+1;
					
					print "link_or_para=$link_or_para\n" if $debug;
					$link_or_para =~ s/(<img.*?src=").*\/(.*?png".*?)/$1$VAR{'base_upload_url'}$akt_upload_subdir$2/gim;
					print "\nlink_or_para=$link_or_para\n" if $debug;
					$link_or_para =~ s/(<img.*?src=".*?").*/$1\/>/gim;
					#$link_or_para =~ s/(<img.*?src=".*).*/$1/gim;
					print "\nlink_or_para=$link_or_para\n" if $debug;
			
					
					
					
					$attachment_id++;
					$VAR{'attachment_title'} = $img_filename;
					$VAR{'attachment_guid'} = $img_url;
					$VAR{'attachment_parent'} = $post_id;				# Parent is actual post
					$VAR{'attachment_id'} = $post_id + $attachment_id;	# post id + attachment id
					$VAR{'attachment_url'} = $img_url;					
					
					print "attachment_title=$VAR{'attachment_title'}\n" if $debug;
					print "attachment_guid=$VAR{'attachment_guid'}\n" if $debug;
					print "attachment_parent=$VAR{'attachment_parent'}\n" if $debug;
					print "attachment_id=$VAR{'attachment_id'}\n" if $debug;
					print "attachment_url=$VAR{'attachment_url'}\n" if $debug;
					#print "img_shortname=$VAR{'img_shortname'}\n" if $debug;
					
					
					
					
 					        
 					# ------------ evualating attachment xml
					my $attachment_text = &get_attachment();
					while ($attachment_text =~ s/\$\$(.*?)\$\$/$VAR{$1}/g) {
						#print "subst $1=>$VAR{$1}\n";
					}
					$attachment_paragraph .= $attachment_text;
 					
 					# save last img link
 					$last_link_or_para = $link_or_para;
 					
 				}
 				
 				# build content
 				$post_paragraph .= '<p>' . $link_or_para . '<\p>';
 			}
 		} 
 		
 		# We don't need the last image since it is thumbnail
 		if (defined($last_link_or_para)) {
 			$post_paragraph =~ s/$last_link_or_para//gim;
 		}
 		
 		$VAR{'post_paragraph'} = $post_paragraph;
        print "post_paragraph=$VAR{'post_paragraph'}\n" if $debug;
        
        # ------------ set category
        $VAR{'post_category'} = $golbal_category;
        $VAR{'post_category_nicename'} = $golbal_category_nicename;
        
		# ------------ guessing Tags
		
		$VAR{'post_tag'} = '';
		my %local_tags;
		foreach my $text ( keys %tags) {
			if ($VAR{'post_paragraph'} =~ m/$text/gi or $VAR{'post_title'} =~ m/$text/gi) {
				if (!defined ($local_tags{$tags{$text}})) {
					$local_tags{$tags{$text}} = 1;
					$VAR{'post_tag'} .= "\t\t<category domain=\"post_tag\" nicename=\"$tags{$text}\"><![CDATA[$tags{$text}]]></category>\n";
     				print "Tag: $tags{$text} found by text: $text\n" if 1<2;
     			}
     		}
		}
		
		# ------------ getting comments 
		my $found=0;
		my $comment_text = '';
		my $ts=time();		# now
		my $res_com = $ua->get($url.$suffix.$ts);
		my $comment = $res_com->content;
		print "comment=$comment\n" if $verbose;
		
		while ($comment =~ m/authorID":"(.*?)\","createDate":"(.*?)","body":"(.*?)"/g) {
			my $this_comment = '';
			$comment_id++;

			
			$VAR{'comment_author'} = $1;
			$VAR{'comment_date'} = $2;
			$VAR{'comment_content'} = $3;
			$VAR{'comment_author_email'} = '';
			if (defined($comment_author_email_adresses{$VAR{'comment_author'}})) {
				$VAR{'comment_author_email'} = $comment_author_email_adresses{$VAR{'comment_author'}};
			} else {
				print '$comment_author_email_adresses{\'' . $VAR{'comment_author'} . '\'} = \'set_here\';' . "\n" ;
			}
			$VAR{'comment_author_url'} = '';
			$VAR{'comment_id'} = $comment_id;
			
			# Replace \r\n by <br/>
			$VAR{'comment_content'} =~ s/\\r\\n/<br\/>/gm;
			
			# Montag, 5. März 2012 - 09:44
			if ($VAR{'comment_date'} =~ m/.*,\s*(\d*)\.\s+(.*)\s+(\d*)\s+-\s+(\d*):(\d*)\s*.*/g) {
				my $day = $1;
				my $month_text = $2;
				my $year = $3;
				my $hour = $4;
				my $minute = $5;
				
				# 2011-08-14 12:34:36
				$VAR{'comment_date'} = sprintf '%04d-%02d-%02d %02d:%02d:00', $year, $month{$month_text}, $day, $hour, $minute;
				
			
			}
			$VAR{'comment_date_gmt'} = $VAR{'comment_date'};
			
			print "comment_author=$VAR{'comment_author'}\n" if $debug;
			print "comment_date=$VAR{'comment_date'}\n" if $debug;
			print "comment_date_gmt=$VAR{'comment_date_gmt'}\n" if $debug;
			print "comment_author_email=$VAR{'comment_author_email'}\n" if $debug;
			print "comment_author_url=$VAR{'comment_author_url'}\n" if $debug;
			print "comment_id=$VAR{'comment_id'}\n" if $debug;
			print "comment_content=$VAR{'comment_content'}\n" if $debug;
			
			
			$this_comment = &get_comment();
			while ($this_comment =~ s/\$\$(.*?)\$\$/$VAR{$1}/g) {
				#print "subst $1=>$VAR{$1}\n";
			}
			$comment_text .= $this_comment;		#concat
			$found++;
		}
		$VAR{'comment_text'} = $comment_text;	
		
		# ------------ setting thumbnail
				# last attachment is thumbnail
 				# <wp:postmeta>
				# 	<wp:meta_key>_thumbnail_id</wp:meta_key>
				#	<wp:meta_value><![CDATA[181]]></wp:meta_value>
				# </wp:postmeta>
 				# 
 				#$VAR{'attachment_id'}
 				$VAR{'postmeta'} = "<wp:postmeta>
			<wp:meta_key>_thumbnail_id</wp:meta_key>
			<wp:meta_value><![CDATA[" . ($VAR{'attachment_id'}) . "]]></wp:meta_value>
		</wp:postmeta>
		";
		
        # ------------ evualating post xml
		my $post = &get_post();
		while ($post =~ s/\$\$(.*?)\$\$/$VAR{$1}/g) {
			#print "subst $1=>$VAR{$1}\n";
		}
		print FILE $post;
		print FILE $attachment_paragraph;		# Attachments after post
        
        # if attachment occured adjust post_id
        $post_id = $post_id + $attachment_id;

       
}

# ------------ evualating footer
my $footer = &get_footer();
while ($footer =~ s/\$\$(.*?)\$\$/$VAR{$1}/g) {
	#print "subst $1=>$VAR{$1}\n";
}
print FILE $footer;

# Close file
close(FILE);

# ================================================================================
# Ready

print "="x60;
print "exported $post_count postings\n";
exit(0);

# ================================================================================
# Definitons of xml structure

sub get_header() {
	return "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<!-- This is a WordPress eXtended RSS file generated by \$\$iWeb2Wordpress\$\$ 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=\"\$\$iWeb2Wordpress\$\$\" created=\"\$\$created\$\$\" -->
<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>\$\$title\$\$</title>
	<link>\$\$base_site_url\$\$</link>
	<description>\$\$description\$\$</description>
	<pubDate>Fri, 06 Apr 2012 19:51:06 +0000</pubDate>
	<language>\$\$language\$\$</language>
	<wp:wxr_version>1.1</wp:wxr_version>
	<wp:base_site_url>\$\$base_site_url\$\$</wp:base_site_url>
	<wp:base_blog_url>\$\$base_blog_url\$\$</wp:base_blog_url>

	<wp:author><wp:author_id>1</wp:author_id><wp:author_login>\$\$author_login\$\$</wp:author_login><wp:author_email>\$\$author_email\$\$</wp:author_email><wp:author_display_name><![CDATA[\$\$author_display_name\$\$]]></wp:author_display_name><wp:author_first_name><![CDATA[\$\$author_first_name\$\$]]></wp:author_first_name><wp:author_last_name><![CDATA[\$\$author_last_name\$\$]]></wp:author_last_name></wp:author>


	<generator>\$\$iWeb2Wordpress\$\$\</generator>";
}

sub get_post() {
	return "
	<item>
		<title>\$\$post_title\$\$</title>
		<link>\$\$post_link\$\$</link>
		<pubDate>Sun, 14 Aug 2011 18:21:30 +0000</pubDate>
		<dc:creator>\$\$author_login\$\$</dc:creator>
		<guid isPermaLink=\"false\">\$\$post_guid\$\$</guid>
		<description></description>
		<content:encoded><![CDATA[\$\$post_paragraph\$\$]]></content:encoded>
		<excerpt:encoded><![CDATA[]]></excerpt:encoded>
		<wp:post_id>\$\$post_id\$\$</wp:post_id>
		<wp:post_date>\$\$post_date\$\$</wp:post_date>
		<wp:post_date_gmt>\$\$post_date_gmt\$\$</wp:post_date_gmt>
		<wp:comment_status>open</wp:comment_status>
		<wp:ping_status>open</wp:ping_status>
		<wp:post_name></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=\"\$\$post_category_nicename\$\$\"><![CDATA[\$\$post_category\$\$]]></category>
\$\$post_tag\$\$
		<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_old_slug</wp:meta_key>
			<wp:meta_value><![CDATA[hello-world]]></wp:meta_value>
		</wp:postmeta>
		<wp:postmeta>
			<wp:meta_key>jabber_published</wp:meta_key>
			<wp:meta_value><![CDATA[1333194928]]></wp:meta_value>
		</wp:postmeta>
		<wp:postmeta>
			<wp:meta_key>_encloseme</wp:meta_key>
			<wp:meta_value><![CDATA[1]]></wp:meta_value>
		</wp:postmeta>
		<wp:postmeta>
			<wp:meta_key>_encloseme</wp:meta_key>
			<wp:meta_value><![CDATA[1]]></wp:meta_value>
		</wp:postmeta>
		<wp:postmeta>
			<wp:meta_key>_encloseme</wp:meta_key>
			<wp:meta_value><![CDATA[1]]></wp:meta_value>
		</wp:postmeta>
		<wp:postmeta>
			<wp:meta_key>_encloseme</wp:meta_key>
			<wp:meta_value><![CDATA[1]]></wp:meta_value>
		</wp:postmeta>
		\$\$postmeta\$\$
		\$\$comment_text\$\$
	</item>
	";
}

sub get_comment() {
	return "
			<wp:comment>
			<wp:comment_id>\$\$comment_id\$\$</wp:comment_id>
			<wp:comment_author><![CDATA[\$\$comment_author\$\$]]></wp:comment_author>
			<wp:comment_author_email>\$\$comment_author_email\$\$</wp:comment_author_email>
			<wp:comment_author_url>\$\$comment_author_url\$\$</wp:comment_author_url>
			<wp:comment_author_IP></wp:comment_author_IP>
			<wp:comment_date>\$\$comment_date\$\$</wp:comment_date>
			<wp:comment_date_gmt>\$\$comment_date_gmt\$\$</wp:comment_date_gmt>
			<wp:comment_content><![CDATA[\$\$comment_content\$\$]]></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>
";
}

sub get_attachment() {
	return "
	<item>
		<title>\$\$attachment_title\$\$</title>
		<link>http://marla.weinschenks.com/direkt/20120402-174009-jpg/</link>
		<pubDate>Mon, 01 Apr 2012 12:40:21 +0000</pubDate>
		<dc:creator>\$\$author_login\$\$</dc:creator>
		<guid isPermaLink=\"false\">\$\$attachment_guid\$\$</guid>
		<description></description>
		<content:encoded><![CDATA[]]></content:encoded>
		<excerpt:encoded><![CDATA[]]></excerpt:encoded>
		<wp:post_id>\$\$attachment_id\$\$</wp:post_id>
		<wp:post_date>\$\$post_date\$\$</wp:post_date>
		<wp:post_date_gmt>\$\$post_date_gmt\$\$</wp:post_date_gmt>
		<wp:comment_status>open</wp:comment_status>
		<wp:ping_status>open</wp:ping_status>
		<wp:post_name></wp:post_name>
		<wp:status>inherit</wp:status>
		<wp:post_parent>\$\$attachment_parent\$\$</wp:post_parent>
		<wp:menu_order>0</wp:menu_order>
		<wp:post_type>attachment</wp:post_type>
		<wp:post_password></wp:post_password>
		<wp:is_sticky>0</wp:is_sticky>
		<wp:attachment_url>\$\$attachment_url\$\$</wp:attachment_url>
		<wp:postmeta>
			<wp:meta_key>_wp_attached_file</wp:meta_key>
			<wp:meta_value><![CDATA[2012/04/20120402-174009.jpg]]></wp:meta_value>
		</wp:postmeta>
		<wp:postmeta>
			<wp:meta_key>_wp_attachment_metadata</wp:meta_key>
			<wp:meta_value><![CDATA[]]></wp:meta_value>
		</wp:postmeta>
	</item>
	";
}

sub get_footer() {
	return "
</channel>
</rss>
";
}
    •    
  • Currently 3.75 / 5
  You rated: 4 / 5 (4 votes cast)
 
[11,363 views]  

Migrate iWeb blog to WordPress | 2 comments | Create New Account
Click here to return to the 'Migrate iWeb blog to WordPress' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Migrate iWeb blog to WordPress
Authored by: lucaslivingston on Apr 23, '12 09:09:24PM

Cool tip. For the simple folk like the rest of us, I would suggest using the Wordpress "RSS Importer" plugin to import your RSS .xml file. You'll find it somewhere on your iDisk. You might want to open import the .xml file into something like Feeder first to see what it looks like, tweak it, then import it into Wordpress. Worked fairly nicely for me at ancientartpodcast.org/blog.



[ Reply to This | # ]
Migrate iWeb blog to WordPress
Authored by: PeterMurbai on Jun 20, '12 10:53:08AM

You should post the original URL http://iweb2wordpress.weinschenks.com

There's a new version up and further instructions. Only 10 days to migrate your blog!



[ Reply to This | # ]