Function: eww--alternate-urls

eww--alternate-urls is a byte-compiled function defined in eww.el.gz.

Signature

(eww--alternate-urls DOM &optional BASE)

Documentation

Return an alist of alternate links in DOM.

Each element is a list of the form (URL TYPE TITLE) where URL is the href attribute of the link expanded relative to BASE, TYPE is its type attribute, and TITLE is its title attribute. If any of these attributes is absent, the corresponding element is nil.

Source Code

;; Defined in /usr/src/emacs/lisp/net/eww.el.gz
;;; Alternate links (RSS and Atom feeds, etc.)

(defun eww--alternate-urls (dom &optional base)
  "Return an alist of alternate links in DOM.

Each element is a list of the form (URL TYPE TITLE) where URL is
the href attribute of the link expanded relative to BASE, TYPE is
its type attribute, and TITLE is its title attribute.  If any of
these attributes is absent, the corresponding element is nil."
  (let ((alternates
         (seq-filter
          (lambda (attrs) (string= (alist-get 'rel attrs)
                                   "alternate"))
          (mapcar #'dom-attributes (dom-by-tag dom 'link)))))
    (mapcar (lambda (alternate)
              (list (url-expand-file-name (alist-get 'href alternate)
                                          base)
                    (alist-get 'type  alternate)
                    (alist-get 'title alternate)))
            alternates)))