generate_blogpost.sh

wordpress

I use Stuart Rackham‘s blogpost.py to publish my pages and posts to WordPress. It’s great!

Unfortunately, when I migrated to WordPress, I imported lots of existing posts and pages that I also wanted to be able to update with blogpost.py. So, I wrote a script to generate the .blogpost files for those posts and pages: generate_blogpost.sh.

The script isn’t too complicated. It just fetches all existing pages and posts from MySQL, finds the corresponding .txt files in the working directory, and generates corresponding .blogpost files using the post ids, types, titles, and permalinks stored in the database.

To run it, simply pass the same parameters you’d pass to mysql, e.g.

$ ./generate_blogpost.sh -h [HOST] -u [USER] [DATABASE]

Tested with blogpost.py version 0.9.3.

Leave a Reply

Your email address will not be published.