Function: newsticker--get-news-by-url-callback

newsticker--get-news-by-url-callback is a byte-compiled function defined in newst-backend.el.gz.

Signature

(newsticker--get-news-by-url-callback STATUS FEED-NAME)

Documentation

Callback function for newsticker--get-news-by-url.

STATUS is the return status as delivered by url-retrieve, and FEED-NAME is the name of the feed that the news were retrieved from.

Source Code

;; Defined in /usr/src/emacs/lisp/net/newst-backend.el.gz
(defun newsticker--get-news-by-url-callback (status feed-name)
  "Callback function for `newsticker--get-news-by-url'.
STATUS is the return status as delivered by `url-retrieve', and
FEED-NAME is the name of the feed that the news were retrieved
from."
  (let ((buf (get-buffer-create (concat " *newsticker-url-" feed-name "*")))
        (result (buffer-string)))
    (set-buffer buf)
    (erase-buffer)
    (newsticker--insert-bytes result)
    ;; remove MIME header
    (goto-char (point-min))
    (search-forward "\n\n" nil t)
    (delete-region (point-min) (point))
    ;; read the rss/atom contents
    (newsticker--sentinel-work nil
                               (or (not status)
                                   (not (eq (car status) :error)))
                               feed-name "url-retrieve"
                               (current-buffer))
    (when status
      (let ((status-type (car status))
            (status-details (cdr status)))
        (cond ((eq status-type :redirect)
               ;; don't care about redirects
               )
              ((eq status-type :error)
               (message "%s: Error while retrieving news from %s: %s: \"%s\""
                        (format-time-string "%A, %H:%M")
                        feed-name
                        (car status-details) (cdr status-details))))))))