Function: newsticker-download-enclosures

newsticker-download-enclosures is a byte-compiled function defined in newst-backend.el.gz.

Signature

(newsticker-download-enclosures FEEDNAME ITEM)

Documentation

In all feeds download the enclosed object of the news ITEM.

The object is saved to the directory temporary-file-directory(var)/temporary-file-directory(fun)/newsticker/FEEDNAME/TITLE, which is created if it does not exist. TITLE is the title of the news item. Argument FEEDNAME is ignored. This function is suited for adding it to newsticker-new-item-functions.

Source Code

;; Defined in /usr/src/emacs/lisp/net/newst-backend.el.gz
(defun newsticker-download-enclosures (feedname item)
  "In all feeds download the enclosed object of the news ITEM.
The object is saved to the directory
`temporary-file-directory'/newsticker/FEEDNAME/TITLE, which
is created if it does not exist.  TITLE is the title of the news
item.  Argument FEEDNAME is ignored.
This function is suited for adding it to `newsticker-new-item-functions'."
  (let ((title (newsticker--title item))
        (enclosure (newsticker--enclosure item)))
    (when enclosure
      (let ((url (cdr (assoc 'url enclosure)))
            (temp-dir (file-name-as-directory
                       (expand-file-name
                        title (expand-file-name
                               feedname (expand-file-name
                                         "newsticker"
                                         temporary-file-directory)))))
            (org-dir default-directory))
        (unless (file-directory-p temp-dir)
          (make-directory temp-dir t))
        (cd temp-dir)
        (message "Getting enclosure %s" url)
        (apply #'start-process "wget-enclosure"
               " *newsticker-wget-download-enclosures*"
               newsticker-wget-name
               (list url))
        (cd org-dir)))))