PERL script to back up Blogger comments

Posted by ljmacphee on August 8, 2007 under blogger, perl, tools | Be the First to Comment

There are many tools for backing up Blogger blogs to Windows but none I could find for us OSX and Linux users.

Here is a PERL script that will fetch your rss comment feed from your blogger blog. It will grab your blogs comments and save them with the same name as on blogger. Comments are then stored in a separate directory for each post.Posts and images are not downloaded with this script.

backup-blogger-comments.pl

If you have Perl installed on your computer then down load the script.
Chmod 755 backup-blogger-comments.pl to make it executable
On line 38 change the 999s to your blog’s blogger id number

Then run the script../backup-blogger-comments.pl

If you have more than 300 comments change the max=300 to a number larger than the number of posts you have posted.

It’s a very fast script and will have your comments backed up in no time.

If, like me you have numerous blogs write a script to back up all the posts and comments like this:

#!/usr/bin/perl
# perl script to call all back up programs for blogger blogs

print “\nBacking up AI posts”;
system ( “./backupai.pl” );

print “\n Backing up AI comments”;
system ( “./backupai-comments.pl” );

print “\nBacking up Mobile posts”;
system ( “./backupmobile.pl” );

print “\n Backing up Mobile comments”;
system ( “./backupmobile-comments.pl” );

print “\nBacking up Recipes post”;
system ( “./backuprecipes.pl” );

print “\n Backing up Recipe comments”;
system ( “./backuprecipes-comments.pl”);

print “\nBacking up Garden posts”;
system ( “./backupgarden.pl” );

print “\n Backing up Garden comments”;
system ( ” ./backupgarden-comments.pl” );

print “\nBacking up Houseplants posts”;
system ( “./backuphouseplants.pl” );

print “\n Backing up Houseplant comments ” ;
system ( “./backuphouseplants-comments.pl” );

print “\nBacking up Webtools posts”;
system ( “./backupwebtools.pl” );

print “\n Backing up Webtools comments “;
system ( “./backupwebtools-comments.pl ” ); 

More information:
Download Perl and help to get you started 

You may need to install Perl modules; see How to install Perl modules 

See also:
Perl script to back up Blogger posts and images

PERL script to back up Blogger posts and images

Posted by ljmacphee on August 6, 2007 under blogger, perl, tools | Be the First to Comment

There are many tools for backing up Blogger blogs to Windows but none I could find for us OSX and Linux users.

Here is a PERL script that will fetch your rss feed from your blogger blog. It will grab your posts and save them with the same name as on blogger. It will then fetch the images from your posts and down load them. Files are stored in a separate directory for each month.

Comments are not downloaded with this script.

BloggerBackup.pl

If you have Perl installed on your computer then down load this file.
Chmod 755 BloggerBackup.pl to make it executable
On line 38 change the 999s to your blog’s blogger id number
Then run the script.
./BloggerBackup.pl

If you have more than 300 posts change the max=300 to a number larger than the number of posts you have posted.

If you have a slow net connection or tons of images it will take a few minutes, be patient. Otherwise it is very fast.

More information:
Download Perl and help to get you started

You may need to install Perl modules; see How to install Perl modules

See also:
Perl Script to back up Blogger comments

PERL script to back up your website using your RSS feed

Posted by ljmacphee on August 3, 2007 under blogger, how to, perl, tools | Be the First to Comment

This is a very simple PERL script that grabs your RSS feed, pulls the link for each page, downloads the text for that page and writes the HTML page to your computer’s hard drive. It creates a separate directory by year and month and stores each HTML page in the directory for the month it was published.

So for this website it would create a root directory ‘herselfswebtools.com’ and directory under that for ‘2007′ and under 2007 it would create directories for ‘01′, ‘02′, ‘03′, ‘04′, ‘05′, ‘06′, ‘07′. The full page including CSS, sidebars, etc will then be written in the proper months directory. As of now it does not download and save images.

This first script is intended to be general and able to back up any rss feed website. ( There are two scripts for blogger on the sidebar as well, details coming on them Monday and Wednesday. Or you can just download they and read the notes in the scripts. )

There are two things you’ll need to change both on this line (63):
$content = get ( “http://www.blogger.com/feeds/9999999999999/posts/default?max-results=500&alt=rss”);

You need to change that series of 99999s to your blog id number and if you have more than 500 posts you’ll want to make that a larger number. Or if you are backing up a non blogger website you should just be able to use the rss feed for that site.

Backup Blogger Posts Perl script

You might need to install a Perl module or two. Just follow the directions if you are not familiar with how to do so.

How to add a Google Calendar to your site

Posted by ljmacphee on July 18, 2007 under blogger, blogger template, hack your template, how to, wordpress | Be the First to Comment

Log onto your Google account and go to GMail.
In the upper left corner is a Calendar link - click it

In the left sidebar is a small link at the bottom ‘Manage calendars’ - click it
Up will come a list of the calendars you’ve created
Click on the link for the calendar you wish to add to your sidebar

Near the bottom you will see a section ‘Calendar Adress:’ and ‘xml’ ‘ical’ ‘html’
Click on the HTML button.

A pop up window will appear and you have two choices. The first is a direct link to your calendar
The second is a ‘configuration tool’ - Click that one

A page will appear with all sorts of details you can select - calendar format, size, &c.
Set things up how you like and click the ‘Update URL’ button.

Code will appear in a box ‘2. Add the calendar HTML to your page’
Highlight and select all the text in that box and paste it into notepad or some other
text tool you like to use.

In Blogger go to Template->Add Page Element->HTML/JavaScript - ‘Add to Blog’
and paste your text into the box and save

In Wordpress, go to Presentation->Themes->Theme Editor and paste it into your sidebar in an
appropriate spot.

Or you can just add it to any HTML page by pasting the text where you want the calendar to be.

You can see an example of this at Herself’s Houston Garden

These are useful for websites and blogs about local hobbies where there are events that will interest your readers. Or for blogs about clubs and organizations such as blogs for local photography clubs. Google calendars are nice since people interested in specific events can then just import them to their own Google calendar.

I found I needed to widen the sidebars in the blogs I put calendars into to about 340px. But I’ve been widening websites to 1000px any how since only about 10% of internet users are still using 800×600 displays.