Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-01-23 16:23:27

James Weiner
Member
From: Oxford, UK
Registered: 2009-01-12
Posts: 14
Website

Problems importing from Blogger

Hi there,

I am trying to import a blog of roughly 150 posts into a textpattern site I’ve set up. I am following this guide: http://textbook.textpattern.net/wiki/index.php?title=Importing_from_Blogger but I’ve had no luck.

When I try and save the new template after pasting in the suggested code I get this error message:

“Your template could not be parsed as it is not well-formed. Please make sure that all XML elements are closed properly.
XML error message: The content of elements must consist of well-formed character data or markup.”

And it refuses to save the new template.

Has anyone got any ideas? I am utterly ignorant about Blogger etc as I only ever fiddle about in Textpattern but I have to move over all the previous posts of this blog to the new one or people will probably get a bit upset with me!

Thanks in advance for any help and suggestions!

James

Offline

#2 2009-01-24 23:20:43

JanDW
Plugin Author
From: Providence, RI, USA
Registered: 2008-07-18
Posts: 327
Website

Re: Problems importing from Blogger

I’ve run into the same problem, I solved it by importing into WordPress first (which is very easy) and then into Textpattern. Unfortunately some (quite a few) articles were imported incompletely and I had to paste in the missing content.

It’s a method but likely still too cumbersome to import 150 posts. I don’t know if there is another “indirect route” that works better.
Looks like the import needs a bit of lovin’.


TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX

Offline

#3 2009-01-25 10:42:32

James Weiner
Member
From: Oxford, UK
Registered: 2009-01-12
Posts: 14
Website

Re: Problems importing from Blogger

Thanks Jan, I’ll give that a go – while it doesn’t sound ideal I don’t have any choice!

Offline

#4 2009-01-25 20:11:26

James Weiner
Member
From: Oxford, UK
Registered: 2009-01-12
Posts: 14
Website

Re: Problems importing from Blogger

So I figured it out. Gah it was so simple!

Basically the blog was running the ‘new’ version of Blogger. So what you have to do is revert it to using the old style of templates.

To do this go to the ‘Layout’ tab, then ‘Edit HTML’ sub-tab.

At the bottom of that page there is a link ‘Revert to Classic Template’, click this (this is the important step).

Once it’s running in this ‘Classic mode’ you can then go ahead with the usual Blogger to TXP conversion guide

Woo!

Hopefully this will help anyone else out there who gets stuck with this silly problem.

Offline

#5 2009-01-25 20:23:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,273
Website GitHub

Re: Problems importing from Blogger

James Weiner wrote:

Basically the blog was running the ‘new’ version of Blogger. So what you have to do is revert it to using the old style of templates.

Glad you got it sorted.

If the template syntax of Blogger has changed, my guess is the next version of TXP / the Textbook documentation should take the alterations into account. Anyone know what the differences between the ‘new’ and ‘old’ Blogger templates are (i.e. is it a complete rewrite or a few tweaks to the formatting?) That might give us an indication of how much work is involved to support the new syntax, or one/both versions.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2009-01-25 20:32:08

James Weiner
Member
From: Oxford, UK
Registered: 2009-01-12
Posts: 14
Website

Re: Problems importing from Blogger

they’ve COMPLETELY changed how it works now – all sorts of nested xml elements of their own making, rather than pseudo-PHP includes. It’s all a bit odd – divided up into <b:section>s and the like, and there are quite a few rules involved to get it right. I had started to figure it all out until I spotted what I’d been missing all along! Plus there are templates in templates (“widgets”) and they need to be unravelled too, it’s a bit tricky to access the code for them all, plus it’s all quite messy code.

Wouldn’t want to go near it myself!

Offline

#7 2009-01-25 20:34:53

James Weiner
Member
From: Oxford, UK
Registered: 2009-01-12
Posts: 14
Website

Re: Problems importing from Blogger

Also, it’s worth noting that even when you do the import the way I did, some nasty inline css etc comes through still – I’m finding a lot of things like

<a style="left: 0px ! important; top: 15px ! important;" title="Block this object with Adblock Plus" class="abp-objtab-07746914868503015 visible" href="http://www.youtube.com/v/DyJpWQi0sBM&amp;hl=en&amp;fs=1"></a>

and

<div style="text-align: justify;">

that I’m having to go through and strip out

Offline

#8 2009-01-25 21:32:59

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Problems importing from Blogger

James Weiner wrote:

that I’m having to go through and strip out

smd_where_used to the rescue! :)

Offline

#9 2009-01-26 15:08:52

James Weiner
Member
From: Oxford, UK
Registered: 2009-01-12
Posts: 14
Website

Re: Problems importing from Blogger

thanks Els – that is great for finding all the instances – but I’d like to edit them all automatically too. Eg run a sort of ‘find and change’ function on them. I’ve got ~150 posts all with that rubbish in them I need to delete and it’s going to take hours using smd_where_used, despite it being very useful otherwise.

I’m looking about for a way to do this but any ideas are welcome. I’m going to attempt to do it via phpMyAdmin to start off with.

Offline

#10 2009-01-26 15:16:33

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,273
Website GitHub

Re: Problems importing from Blogger

James Weiner wrote:

thanks Els – that is great for finding all the instances – but I’d like to edit them all automatically too.

I did consider this as an option when I wrote the plugin but it had so much potential to screw up I shied away from it, sorry. One day, maybe.

In the meantime, have you checked out lam_search_replace? I think it only searches articles but it might help.

Last edited by Bloke (2009-01-26 15:16:48)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#11 2009-01-26 15:22:00

James Weiner
Member
From: Oxford, UK
Registered: 2009-01-12
Posts: 14
Website

Re: Problems importing from Blogger

Thanks Stef – yeah I just found that now. I’m going to give it a go now. Cheers!

Offline

#12 2009-01-26 16:27:38

James Weiner
Member
From: Oxford, UK
Registered: 2009-01-12
Posts: 14
Website

Re: Problems importing from Blogger

so lam_search_replace really wouldn’t work for me – caused all sorts of problems emptying posts and getting mysql errors.

did a bit of googling and came up with this useful quick guide to running search and replace from phpmyadmin.

I used queries like this:

UPDATE `textpattern` SET `Body` = replace(Body, ‘</span>’, ‘’)

Which looks inside the table ‘textpattern’, then the field ‘Body’ and finds every occurence of </span> and replaces it with nothing.

Offline

Board footer

Powered by FluxBB