From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Thole Subject: Blogs, org-mode, and wordpress Date: Thu, 28 Jan 2010 08:42:12 -0600 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NaVa1-0004zu-I6 for emacs-orgmode@gnu.org; Thu, 28 Jan 2010 09:42:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NaVZv-0004qE-N9 for emacs-orgmode@gnu.org; Thu, 28 Jan 2010 09:42:43 -0500 Received: from [199.232.76.173] (port=44152 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaVZv-0004pR-C6 for emacs-orgmode@gnu.org; Thu, 28 Jan 2010 09:42:39 -0500 Received: from mx20.gnu.org ([199.232.41.8]:47374) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NaVZt-00036v-8u for emacs-orgmode@gnu.org; Thu, 28 Jan 2010 09:42:37 -0500 Received: from mail-px0-f192.google.com ([209.85.216.192]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NaVZr-0000TW-Ae for emacs-orgmode@gnu.org; Thu, 28 Jan 2010 09:42:35 -0500 Received: by pxi30 with SMTP id 30so522013pxi.14 for ; Thu, 28 Jan 2010 06:42:33 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hey all, I wasn't sure if anyone tried to do something similar or not. I am moving web services, and moving blog engines to wordpress - and I thought about org-mode and how much it'd be better to have blogs inside org mode. For the past month and a half or so, I've been working on that solution. The reason I'm emailing the group is to get a feel for all those who've done something like this before, what their solution was, and if anyone is interested in this solution. So this email I hope to gather that feedback, and explain what I've done in a fair bit of detail as well. The organization of the blog-setup is fairly simple. In a dedicated directory, named blogs, I have an index.org file. Inside that org file, I have the following general structure: #+CATEGORIES: Blog_Category_1 Blog_Category_2 ... ... * Status: Categories: Blog_Category_1 Blog_Category_2 ... File: [[file:YYYY-MM-DD.org][YYYY-MM-DD]] CMD5: For each blog file, there's 1 per day. The general format of the file is just the straight up content of the blog. Right now it supports links, bold, and italics. I hope to add others as needed, including images later. For the actual program itself, there are two parts: org-sync.lisp cl-wordpress cl-wordpress is simply a library for common lisp, that will interface with wordpress through XMLRPC. I spent a large amount of time on this, and this project itself will be published fairly soon. org-sync.lisp does the following operations on a sync: - Parse index.org - For any blogs that are in state "Publish", create a MD5Sum of the file, convert the org-specific tags to HTML tags, and push to cl-wordpress. After that, change the state from "Publish" to "Published" - For any blogs that are in state "Draft", do nothing. - For any blogs that are in state "Published", read the blog file itself. Generate an MD5 of the file contents, and compare with the stored value for the MD5. If they differ, call an updateBlogEntry function within cl-wordpress which will update the blog. In short, this is determined by the title, that doesn't change in this system. - At the end, write all the index.org file once again, with the changes to the org-objects. The goal of this was to be able to write the org-files locally, and when I want them to be published, I change the state accordingly. I would then have a cron job that would: - Update museorg (my git repository of org, org-notes, and some muse-mode documents) - Run the sync function from the org-sync.lisp file - Run git commit && git push. I hope this makes sense on the general way I went with this, and why. I hope to eventually be able to change this to using cl-org-mode, but that depends on how useful it'd be for others to have this library published. Right now as it stands, I'll have cl-wordpress up by the end of next week, hopefully on common-lisp.net, but org-sync is the one I'm not sure yet. If others find it interesting, and helpful, I'll clean up the code, document, test, and push it out to github or common-lisp.net. Thoughts and feedback definitely welcome. -David http://www.thedarktrumpet.com