skeeto / elfeed

An Emacs web feeds client
The Unlicense
1.51k stars 118 forks source link

gnus's rss can download feeds with auto generated bashscript, can elfeed add this feature too? #132

Open tumashu opened 8 years ago

tumashu commented 8 years ago

my emacs halt too long for slow bandwidth when fetch feed with elfeed, gnus has a sample way which can make things better, auto generate a script then run this script with cron,I think this is useful to elfeed

(defun nnrss-generate-download-script ()
  "Generate a download script in the current buffer.
It is useful when `(setq nnrss-use-local t)'."
  (interactive)
  (insert "#!/bin/sh\n")
  (insert "WGET=wget\n")
  (insert "RSSDIR='" (expand-file-name nnrss-directory) "'\n")
  (dolist (elem nnrss-server-data)
    (let ((url (or (nth 2 elem)
                   (second (assoc (car elem) nnrss-group-alist)))))
      (insert "$WGET -q -O \"$RSSDIR\"/'"
              (nnrss-translate-file-chars (concat (car elem) ".xml"))
              "' '" url "'\n"))))
skeeto commented 8 years ago

This is a neat idea I'll have to investigate. Currently feeds are already fetched asynchronously, and, for most people, the brief lockups are due to parsing XML and such after the feed is downloaded. Downloading the feed with wget and then parsing it in Emacs would have the same results. It may be worth parsing the XML into an s-expression (i.e. elfeed-xml-parse-region) and feeding that to Emacs, since that can be parsed much faster.

As far as I can tell, Emacs' DNS queries are synchronous. So if DNS is slow to respond, Emacs will freeze each time it fetches from a new domain, which is what you may be experiencing. It's much worse on Windows, which also has a synchronous connect() -- and since feeds are generally rather small, this effectively synchronizes fetching -- though this will be fixed in a future Emacs release (see Emacs bug#20159).

tumashu commented 8 years ago

Expect this feature ....