From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Blogging org entries using google command line. Date: Wed, 08 Sep 2010 16:32:26 -0600 Message-ID: <87vd6fj1cb.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=59742 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtTUv-0005by-Mm for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 18:52:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OtTUu-00023W-MW for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 18:52:09 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:38893) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OtTUu-00023K-J9 for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 18:52:08 -0400 Received: by iwn33 with SMTP id 33so619652iwn.0 for ; Wed, 08 Sep 2010 15:52:07 -0700 (PDT) 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: Richard Riley Cc: emacs-orgmode@gnu.org Hey Richard, That looks interesting. See the gdoc-write code block defined in the library-of-babel in the org repo at contrib/babel/library-of-babel.org which allows saving Org-mode data to google docs using the google command line. Maybe your function would be suitable for addition to the library-of-babel? Cheers -- Eric Richard Riley writes: > Using the google command line you can get some super access to all your > Google resources - including docs, calendars & blogs. > > http://code.google.com/p/googlecl/ > > Once you have installed it and set up your OAUTH you can easily > manipulate/add/delete things in your google hosted data. > > While not polished and featuring hard coded blog name the following > function uses the google command line tool to blog the current > org-entry. > > (defun rgr/org-blog-entry () > (interactive) > (save-excursion > (let ((tmpheading (org-get-heading))) > (goto-char (org-entry-beginning-position)) > (set-mark (org-entry-end-position)) > (let*((tmpfile (make-temp-file "org-blog-html-")) > (blog-command (concat "google blogger post --blog \"Open Sauce\" --title '" tmpheading "' " tmpfile ))) > (org-export-as-html 1 nil nil (find-file-noselect tmpfile) t) > (with-current-buffer (get-file-buffer tmpfile) (save-buffer)) > (start-process-shell-command "Google Blog" "*googlecl*" blog-command))))) > > At some point I'll try and make it more generic with customised options > if no one beats me to it .. > > regards > > r.