Importing from blogger to blosxom

I finally hacked it myself, coz I wanted the filename in my format (static date funda), and i thought it is not going to be very difficult.

The steps are -
1. Render the blogger using a simple template as given below

<Blogger>
START_OF_ENTRY

<$BlogItemDateTime$>

START_OF_DATA

<$BlogItemSubject$>

<$BlogItemBody$>

END_OF_ENTRY

</Blogger>

Don’t forget to set the no of posts to max ie 999 in settings. It will take some time to render it, so be patient.

Save the rendered data to a file and add END_OF_THE_WORLD at the end of the file.

2. now run the following script on the file

#!/bin/shwhile [ 1 ]; do        read data        if [ “$data” == “END_OF_THE_WORLD” ] ; then                break;        fi        if [ “$data” == “START_OF_ENTRY” ]; then                read date                echo $date                file=”blog/`date +%s -d \”$date\”`.txt”                echo $file                read data                while [ 1 ]; do                        read data                        if [ “$data” == “END_OF_ENTRY” ]; then                                 break;                        fi                        echo $data >> $file                done        fidone

It will crete filename using the timestamp and store the data into it.

3. Now the mannual step. To move the data to the appropriate category.
I used a simple script for that

for i in *.txt; do echo $i; head $i; read path; mv $i $path; done

THATS IT. now my blosxom is COMPLETE smile

Leave a Reply