Import from blogware .xml file to WP

UPDATE: I tried it and it works just fine. But need to modify a little to make the GMT offset works.
Details here: http://mosquito.wordpress.org/view.php?id=878

When importing an rss2 feed I discovered all posts dats were set to GMT time and the offset seemed to be ignored. Found that the values were simply being switched. Made the following changed to lined 148-149 in import-rss.php

148: switch variables
DATE_ADD(‘$post_date’, INTERVAL ‘$add_hours:$add_minutes’ HOUR_MINUTE)
and
‘$post_date’

149: replace
$post_date
with
DATE_ADD(‘$post_date’, INTERVAL ‘$add_hours:$add_minutes’ HOUR_MINUTE)

Quoted from http://wordpress.org/support/topic.php?id=28115.

I just got it to work. There seems to be two problems:

1. The import-rss.php file is looking for a or type of tag.

2. The excerpts that Blogware exports seems to be problematic. The import-rss.php file *seems* to read in the title, date, etc that it wants and then assumes the rest is the actual entry. Not true in Blogware’s case – the excerpt comes before the body.

To solve problem 1:

In the import-rss.php file, find the line that says:

preg_match_all(‘|(.*?)|is’, $importdata, $posts);
and change it to:
preg_match_all(‘|(.*?)|is’, $importdata, $posts);

To solve problem 2:

Find the line that says:
preg_match(‘|(.*?)|is’, $post, $content);
and change to to read:
preg_match(‘|(.*?)|is’, $post, $content);

I also changed the line that said:

preg_match(‘| (.*?)|is’, $post, $date);
to
preg_match(‘| (.*?)|is’, $post, $date);

But I’m not sure that was required.

With respect to point number 1: This will only import your articles. If you have photos, reviews, whatever else, then you will have to manually change the to and then run it again. Then change it to and run it again..and so on until all your different post types are imported.

There is syntax to tell preg_match() to look for

Related posts

Leave a comment

0 Comments.

Leave a Reply


[ Ctrl + Enter ]