Non-DRM Mobi books, like free e-books found online in Mobi format, or files you convert to Mobi files, are already supported on Kindle.
There are converters available from Amazon and/or Mobi for pdf and doc files.
The Kindle supports Mobipocket files directly. You don't need to write a script to do that.
Hacker Igor Skochinsky used DRM to load Mobipocket books onto his Kindle. Using a series of scripts, he's able to convert eBook files to Amazon's AZW format and then add the necessary serial number DRM, specialized per an individual's particular Kindle.
A revolutionary portable reader that wirelessly downloads books, newspapers, magazines and blogs to a crisp, high-resolution electronic paper display that looks and reads like real paper, even in bright sunlight.