I'd like to export my blog posts to plain text files so I can version control and update them using emacs org-mode via the org2blog package. However, I'm unfamiliar with SQL and the wordpress database structure. I'm hoping to get ideas for a SQL script to export my posts where each post is stored to a file named "YYYY-MM-DD_Title-of-post.org" and where the files will look like:
#+POSTID: 1071 #+DATE: [2011-09-21 Wed 18:00] #+OPTIONS: toc:nil num:nil todo:nil pri:nil tags:nil ^:nil TeX:nil #+CATEGORY: cat1, cat2, cat3 #+TAGS: tag1, tag2, tag3 #+DESCRIPTION: #+TITLE: Hello World ### URL: http://... BODY OF POST
The parts to be filled in is the DATE field, CATEGORY, TAGS, TITLE, URL, and BODY OF POST.
I think it might be asking too much to have someone do all my work for me. So, alternatively, I'd be content with a SQL script that outputs those fields in a delimited file, say delimited by "|||" so I can write a script elsewhere to get what I want.
Thanks for your help. Much appreciated!