Org-Quotes ========== This was a quick weekend (well, two Fridays and a Sunday) project to do some org-mode file parsing to get some useful work done. make-post.php ------------- This was the original Friday hack. The idea is that we have an org-mode file with a specific structure: * Root Element ** Reporter One Name *** First Source-Person Name Quote body text *** Second Source-Person Name Quote body text ** Reporter Two Name We parse that, offer an HTML form to select one quote from each reporter, then dump all the selected quotes to a (partial) HTML file that we can use as a Wordpress post. word2org.sh ----------- This happened later that Friday, when I had to deal with some quotes that had already been typed by an assistant. The assistant had typed up a bunch of quotes into Microsoft Word. Blech. Fortunately for me she(? I haven't actually met said person) did it in a fairly disciplined structure, so that after copy/pasting into a text-file, I could parse it into an org-mode file with the above structure. I wrote a quickie bash script to do this. For reference, the format of this text is: “Quote body” - Quote Source “Quote body” - Quote Source Reporter: Reporter Name upload-org.php/upload-ms-word.php --------------------------------- The next week I discovered that the proxy I had to work behind had been reconfigured, and I couldn't figure out tunnel SSH through it. So I couldn't SSH in, paste the MS Word data into an Emacs buffer, then run it through `word2org.sh`, then `mv` it to the location looked for by [what is now named] `make-post.php`. So, when I got home I make `upload-msword.php` and `upload-org.php` so that I could paste in either org-mode or MS Word formatted quotes from a browser behind the proxy, and still get work done /at work/. So yeah, `upload-msword.php` uses the system() PHP call to run word2org. Go ahead, shoot me, but this was never meant to be a polished project. Other Notes ----------- Yeah, I did all the bad-practice spitting-out-HTML-from-logic-code and using globals stuff. This was a quickie hack. It's basically just one PHP script (at least on the PHP side). Don't worry, my other projects use MVC and all that.