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.

Blogger.com to Serendipity Import script

Serendipity is extensively customisable and has quite a number of plugins available to enhance the basic feature set. It is developed in PHP, which being my favourite server-side programming language for web applications, has inspired me to study the code deeper and write code to help the Serendipity community. I shall begin my contribution to the Serendipity project by sharing a teeny weeny script I wrote to import all my posts (and comments) from Blogger.com. Blogger.com service is the same thing as Blogspot blogs.

Just place this Blogger.com To Serendipity Import file in the Serendipity directory and access it from a browser. Follow the instructions it gives. There are a few steps you need to take to make sure it goes well, so be careful.

If you have comments or suggestions, feel free to drop me a line.

Update (29/11/2005): My code has since been integrated into the Serendipity distribution as an importer by the project developers and now comes standard as part of all their new releases!