From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Kowalski Subject: Re: Add TODO from external app? Date: Wed, 2 Apr 2014 03:07:40 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVhLI-0007kF-36 for emacs-orgmode@gnu.org; Thu, 03 Apr 2014 09:06:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVhLC-0006Cf-I8 for emacs-orgmode@gnu.org; Thu, 03 Apr 2014 09:06:03 -0400 Received: from plane.gmane.org ([80.91.229.3]:38545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVhLC-0006CN-80 for emacs-orgmode@gnu.org; Thu, 03 Apr 2014 09:05:58 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WVgcq-0003PG-Gj for emacs-orgmode@gnu.org; Thu, 03 Apr 2014 14:20:08 +0200 Received: from c-71-198-175-133.hsd1.ca.comcast.net ([71.198.175.133]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Apr 2014 14:20:08 +0200 Received: from jeff.kowalski by c-71-198-175-133.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Apr 2014 14:20:08 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org I use org-etml to serve pages from within emacs and use a custom capture handler, like this: #### (defun jeff/capture-handler (request) "Handle REQUEST objects meant for 'org-capture'. GET header should contain a path in form '/capture/KEY/LINK/TITLE/BODY'." (with-slots (process headers) request (let ((path (cdr (assoc :GET headers)))) (if (string-match "/capture:?/\\(.*\\)" path) (progn (org-protocol-capture (match-string 1 path)) (ws-response-header process 200)) (ws-send-404 process))))) (setq jeff/org-ehtml-handler '(((:GET . "/capture") . jeff/capture-handler) ((:GET . ".*") . org-ehtml-file-handler) ((:POST . ".*") . org-ehtml-edit-handler))) (when t (mapc (lambda (server) (if (= 3333 (port server)) (ws-stop server))) ws-servers) (ws-start jeff/org-ehtml-handler 3333)) #### And the relevant org-capture looks like #### ("b" "entry.html" entry (file+headline (concat org-directory "toodledo.org") "TASKS") "* TODO [#C] %:description\nSCHEDULED: %t\n%:initial\n" :immediate-finish t) #### Then, I post from a hosted form served as entry.html via org-ehtml, like this: ### Org Entry


#### Forwarding ports from my machine running org-ehtml on emacs means I can access the page anywhere to add new tasks even from my cell phone. You could easily call this emacs-webservice from a PHP page, but it's just as easy to simply serve the page from emacs itself. Take a look at org- ehtml and the companion webserver that Schulte wrote.