Blogger to Serendipity importer script v2

I had occasion last night to revisit the Blogger to Serendipity importer script I wrote a few years ago, while helping someone move from Blogger to something that packs a bit more punch.

Serendipity has been carrying the script I wrote bundled as part of the importers available in its core package, thanks to Garvin Hicking (lead developer at the Serendipity project) who had done the dirty work of integrating my code into the project. Anyway, last night when I got about to importing the blog on Blogger into a fresh install of Serendipity, I found myself annoyed by the tediousness of the process required by the very importer I'd authored. Blogger didn't have any export feature back then nor did it provide API access. As a result, the (popular) method for exporting a blog from Blogger had involved setting a special template as the blog's layout and tweaking around a few other settings, after which the blog is published and the output parsed to extract what is needed.

Things have, of course, changed dramatically and for the good in the years since, as Google has continued to open up its services for developers via public APIs. Encouraged by the simplicity of the API, I ended up spending a little bit of time to rewrite the importer almost from scratch. The highly desirable "export blog" feature in the Blogger Data API allows obtaining an XML based dump of the entire blog, which can then be moulded however to fit ones needs.

Download

- Download s9y-bloggerimporter-v0.2.zip (3.3Kb)

Requirements

- PHP 5

Installation

- Extract the contents of the Zip file.
- Upload (or copy) the file "blogger.inc.php" to the folder "include/admin/importers" under the main Serendipity installation path. Make sure the old file is replaced with the new.

Usage

The new importer script can transfer posts (both published and drafts), comments (including comment moderation settings) and authors, without breaking sweat. The process for importing a blog is simple:
1. Login to Blogger/Google and login to Serendipity Administration Suite.
2. Navigate to "Import data" using the menu and select Blogger.com as the type of import.
3. Click the "Go to Google" link to jump to a special authorization request page that allows the importer to access the blogs. [Image 1]
4. Click the "Grant access" button and wait to be taken back to Serendipity. [Image 2]
5. Select the blog to import from the list. [Image 3]
6. Optionally, select the category for the imported posts, set desired trackback behavior, select a charset. [Image 3]
7. Click "Import now!". (see Image 3]
8. Posts (and its comments) are processed and import results displayed.


Image 1


Image 2


Image 3


Enjoy!

Update (17-Feb-2009): This has been adopted into the Serendipity code base and would be available bundled-in with future releases from the project.

Trackbacks

  1. Dinner Diary and Design Overhaul

    I have decided to shift the Dinner Diary I was maintaining on Facebook to my blog, Dawndew. Up until two years ago, during the time when I lived alone, the most complicated dish I could fix was spaghetti bolognese with sauce from a Dolmio jar; although

Comments

Display comments as (Linear | Threaded)

  1. anon.... says:

    serendipity good....your wife's dinner the best....damn u get good food

  2. Millennium says:

    Hi,

    I have a problem with your script - perhaps you can help. I installed the new version as described but now I'm getting an PHP error:
    Parse error: syntax error, unexpected T_OBJECT_OPERATOR in [myHomePATH]/include/admin/importers/blogger.inc.php on line 194

    Do you have an idea how I can get the script working? Thanks!

    Millennium

  3. jaa says:

    You would need PHP 5. Switch to PHP 5 if your web host supports it.

    Good luck!

  4. Grimnir says:

    Hi,

    thank you for your nice script! Unfortunately it doesn't work on texts with german umlauts (and, so I think, with special chars of other languages): At the first umlaut of each caption, blog entry and comment, it breaks off. So I have in Serendipty only the very first words of the whole entry. The problem still occurs if I switch from ISO-8859-1 to UTF 8.

    Is there a way to solve this problem? Or will I have to manually delete the umlauts in Blogger and reinsert them in Serendipity?

    Greetings & thanks,
    Grimnir

  5. Deni says:

    Thank you so much about this wonderful script! I have some problems with Blogger and I decided to migrate to Serendipity. I was ready to leave behind my old entries, but thanks to you, I don't have to do it! Thank you!


Add Comment


HTML-Tags will be converted to Entities.
Standard emoticons like :-) and ;-) are converted to images.
To leave a comment you must approve it via e-mail, which will be sent to your address after submission.