]> gitweb.fperrin.net Git - atom.git/blobdiff - atom.el
Add a function to write an Atom feed to a file.
[atom.git] / atom.el
diff --git a/atom.el b/atom.el
index c645cdabe08313b160472b6e32767c179dadd351..c73c7d90704d10c8140183bff29e23e9d18a4603 100644 (file)
--- a/atom.el
+++ b/atom.el
@@ -167,6 +167,12 @@ fragment. See `atom-add-entry' for additional details."
   (xml-print atom)
   (insert "\n</feed>"))
 
+(defun atom-write-file (atom filename)
+  "Writes the feed ATOM to FILENAME."
+  (with-temp-buffer
+    (atom-print atom)
+    (write-region (point-min) (point-max) filename)))
+
 \f
 (defun atom-format-time (&optional time)
   "Format a time according to RFC3339."