X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=mixi-atom.el;h=3c955e927f52ba8c04b2955943544600591c396a;hb=6c5715573f3f081d5840f74474c9e124346656a3;hp=cfaaa4d90dd538a3528db90386d401997616d843;hpb=110f5b6db8998fd340ef2075e3d9794b2757c18a;p=elisp%2Fmixi.git diff --git a/mixi-atom.el b/mixi-atom.el index cfaaa4d..3c955e9 100644 --- a/mixi-atom.el +++ b/mixi-atom.el @@ -49,6 +49,11 @@ :type 'string :group 'mixi) +(defcustom mixi-atom-file "~/atom.xml" + "*File name for `mixi-make-atom-file'." + :group 'mixi + :type 'string) + (defcustom mixi-atom-syndication-list '((mixi-get-diaries . 10)) "*A list of atom syndication definition. @@ -71,11 +76,6 @@ RANGE is the range for getting articles. If RANGE is nil, get all articles." (radio (integer :tag "Range") (const :tag "All" nil))))) -(defcustom mixi-atom-file "~/atom.xml" - "*File name for `mixi-make-atom-file'." - :group 'mixi - :type 'string) - (defmacro mixi-atom-make-date (time) `(let ((date (format-time-string "%Y-%m-%dT%T%z" ,time))) (if (string-match "[+-][0-9][0-9][0-9][0-9]$" date) @@ -116,10 +116,9 @@ RANGE is the range for getting articles. If RANGE is nil, get all articles." objects) entries)) -;;;###autoload (defun mixi-make-atom () "Make Atom Syndication Format" - (insert "\n" "\n" "\n" @@ -146,9 +145,17 @@ RANGE is the range for getting articles. If RANGE is nil, get all articles." "\n")) ;;;###autoload -(defun mixi-make-atom-file () +(defun mixi-atom-cgi () + (princ (concat "Content-Type: application/atom+xml; charset=" + (symbol-name mixi-atom-coding-system) "\n" + "\n" + (encode-coding-string (mixi-make-atom) + mixi-atom-coding-system)))) + +;;;###autoload +(defun mixi-atom-file () (with-temp-buffer - (mixi-make-atom) + (insert (mixi-make-atom)) (let ((coding-system-for-write mixi-atom-coding-system) (file (expand-file-name mixi-atom-file))) (write-region (point-min) (point-max) file))))