1 ;;;_ org2blog/main.el --- Code for exporting org-mode to g-client
5 ;; Copyright (C) 2010 Tom Breton (Tehom)
7 ;; Author: Tom Breton (Tehom) <tehom@panix.com>
8 ;; Keywords: convenience, tools, outlines
10 ;; This file is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; This file is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to
22 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
34 (unless (boundp 'org-html-cvt-link-fn
)
35 (error "Requires a different version of org-mode. See README.org"))
37 (require 'org2blog
/l2r
)
42 (add-hook 'g-app-afterpost-hook
43 #'org2blog-l2r-store-remote-url-yx
)
47 (defun org2blog-post ()
48 "Export the current org buffer to gblogger."
52 (error "Only useful in an org-mode buffer"))
56 (org-file-name (expand-file-name buffer-file-name
))
57 (org-export-inbuffer-options-extra
58 '(("BLOGLABELS" :blog-labels
)))
59 (plist (org-infile-export-plist))
63 (plist-get plist
:blog-labels
)))
65 (split-string labels-string
"," t
)
69 (plist-get plist
:title
)
73 ((org-html-cvt-link-fn #'org2blog-l2r-cvt-link
))
74 (org-export-as-html nil nil nil
'string t
)))
76 (gblogger-blog->posting-url
(gblogger-ensure-blog)))
78 (gblogger-new-entry url title str org-file-name
)))
79 (with-current-buffer buffer
80 (dolist (label blog-labels
)
81 (gblogger-add-label label
)))))
83 ;;;_ , org2blog-dir-add-new-photos
85 (defun org2blog-dir-add-new-photos (directory album-name
)
86 "Add photos in a directory to specified album except those
87 that are already on a remote site"
91 (read-directory-name "Directory: " default-directory nil t
)
92 (gphoto-choose-album)))
93 (gphoto-directory-add-photos-x
97 (not (org2blog-l2r-remote-url file
)))))
103 (provide 'org2blog
/main
)
105 ;;;_ * Local emacs vars.
106 ;;;_ + Local variables:
111 ;;; org2blog/main.el ends here