Skip to main content

Blogdrive Downloader ...

Blogdrive is a cool blog platform for novices and beginners. I have started to blog there around 2001 and then went ahead to diversify my blogs across Google Blogger and Wordpress. Whilst it endeavours to fulfil most of the bloggers' needs a few advanced features like 'Bulk Import', 'Bulk Export' when you want to backup the blog and restore it etc are amiss. This has been confirmed in a Wordpress forum too where people suggest to use Moveable Type format as an intermediate.  I have also briefly explained about this my new travelog over here.

The other way what I could suggest though a bit rudimentary would be to use the archive URL and download the contents to your local storage. A quick lines of code for the same using PHP would be as below:

Please note that I am using a system command called 'wget' to download the remote file. This is a built-in command for (Ubuntu) Linux and also the path format is a typical Unix. This is just a startup idea. There are a lot of things to improve that you can do and help yourself:


  • If it is a 404 error page you can filter out the file from being preserved in the local path.

    HINT: I think 404 page would not have the normal contents but 'Hello Mister' as one of the strings.
  • A nice GUI with a progress bar perhaps using PHP GTK :)




  $blogdriveBaseURL = "http://yourblogdriveurl.blogdrive.com/";
  $howmanyposts = 400; //You can get this from your dashboard
  $localpathtosave = "/home/lavanyadeepak/Desktop/blogdrive/"; //Local Path where you want to save the contents

  for ($j=0;$j<=$howmanyposts;$j++)
  {
     echo "Downloading post $j
";
     $downloadcommand = "wget --quiet -O $localpathtosave$j.html $blogdriveBaseURL$j.html";
     shell_exec($downloadcommand);
     echo "Download of $j complete
";
  }

  echo "All downloads complete. Thank you for using Blogdrive Downloader
";
?>

Comments

Popular posts from this blog

Google NCR

Google NCRMost of you would be knowing about this trick in navigating to Google generic website. But I just came to know only a few days before and hence thought I would share the information with others too.
Whenever you type http://www.google.com/, Google automatically tries to redirect you to your country-specific website. For me, it always redirects to http://www.google.co.in/ (Google India). But when we specifically want to navigate to Google Generic website for some reason, there are two ways to accomplish the same.Click the 'Go to Google.com' link at the bottom of the webpage that is displayed from http://www.google.co.in/To prevent this redundant click, you can opt to type http://www.google.com/ncr/ which would prevent the redirect from happening. The NCR stands for No Country Redirect. There is a brief discussion about this NCR over this forum.You may also like to check out Google help documentation regarding the country redirections from here.

Elegant 'MailTo' Replacement

Elegant 'MailTo' Replacement

MailTo tags have become a bane to all websites since spammers run spam robots which crawl the web to capture the email addresses, add to their catalogs and send spams to them. I just thought of sharing with others a simple JavaScript function which would trigger open the default email client instead of having mailto: embedded in the HTML Page.

Just have the following function included in your webpage

<script language='Javascript'>
function WriteMailTo(user,domain)
{
location.replace ('mailto:'+user+'@'+domain);
}
</script>

And whereever you want to invoke the mailto, just called WriteMailTo('user','example.com') and the user's default email client should be launching (if configured) without any hassles.

Contacts import utility from Web2Project to Addressbook

I have been using Web2Project for planning my personal and professional tasks for a few years now. Now I have bifurcated the tools into the following:

Project PierAddress Book The only issue I had was to import my addressbook from Web2Project to AB. PP is a different animal. It does not serve as a comprehensive candidate for addressbook and hence I needed this bifurcation. 
I wrote up a following simple script to import the contacts to AB. The pre-requisite for this script is to hop on to PhpMyAdmin, export the contacts as a PHP array and then  modify the path in our import script to whatever you downloaded from PhpMyAdmin.
Our import script would explode the entries as SQL scripts into the browser window. Copy them and execute into PhpMyAdmin AB database to have the contacts imported.

Script URL: https://gist.github.com/lavanyadeepak/5177500#file-import-php