Function: newsticker-opml-import

newsticker-opml-import is an interactive and byte-compiled function defined in newst-backend.el.gz.

Signature

(newsticker-opml-import FILENAME)

Documentation

Import OPML data from FILENAME.

Feeds are added to newsticker-url-list and newsticker-groups preserving the outline structure.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/net/newst-backend.el.gz
(defun newsticker-opml-import (filename)
  "Import OPML data from FILENAME.
Feeds are added to `newsticker-url-list' and `newsticker-groups'
preserving the outline structure."
  (interactive "fOPML file: ")
  (set-buffer (find-file-noselect filename))
  (goto-char (point-min))
  (let* ((node-list (xml-parse-region (point-min) (point-max)))
         (title (car (xml-node-children
                      (car (xml-get-children
                            (car (xml-get-children (car node-list) 'head))
                            'title)))))
         (body (car (xml-get-children (car node-list) 'body)))
         (outlines (xml-get-children body 'outline))
         (imported-groups-data (newsticker--opml-import-outlines outlines)))
    (add-to-list 'newsticker-groups (cons title imported-groups-data) t))
  (customize-variable 'newsticker-url-list))