unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* functions to download mailing list archives
@ 2022-06-12 22:30 GH
  2022-06-12 23:04 ` Óscar Fuentes
  2022-06-16  0:13 ` GH
  0 siblings, 2 replies; 11+ messages in thread
From: GH @ 2022-06-12 22:30 UTC (permalink / raw)
  To: Help GNU Emacs


I love mailing lists,

so Im writing functions to interact with ~lists.gnu.org~ http interfaces

For example this function to download lists mbox archives:

#+begin_src elisp

(defun lists-mbox-recursive-download (url-head id date)
  "Download ID mailing lists archives as mbox files from server
URL-HEAD using a DATE filter.

URL-HEAD is the mailing list server url, example:
https://lists.gnu.org"
  (with-current-buffer "*eww*"
    (shr-next-link)
    (if (string-match (format "%s/archive/mbox/%s/%s\\(.+\\)" url-head id date)
		      (thing-at-point 'url))
	(eww-download))
    (if (save-excursion (shr-next-link))
	(lists-mbox-recursive-download url-head id date))))

#+end_src

I call that function from this another func:

#+begin_src elisp

(defun lists-load-archive (url-head id)
  (if (y-or-n-p "Load as mbox files?")
      (prog1 (eww-browse-url (format "%s/archive/mbox/%s/" url-head id))
	(if (y-or-n-p "Download archive mboxes?")
	    (let ((date (read-number "Date filter: " 20))
		  (eww-download-directory (read-file-name "Download directory: ")))
	      (lists-mbox-recursive-download url-head id date))))
    (eww-browse-url (format "%s/archive/html/%s/" url-head id))))

#+end_src

test it:

(lists-load-archive "https://lists.gnu.org" "help-gnu-emacs")


But sadly the recursion stop with this warning:

file-local-name: Lisp nesting exceeds `max-lisp-eval-depth'

any idea to fix?



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-06-16 12:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-12 22:30 functions to download mailing list archives GH
2022-06-12 23:04 ` Óscar Fuentes
2022-06-13 12:43   ` GH
2022-06-13 16:46     ` Óscar Fuentes
2022-06-13 18:41       ` GH
2022-06-13 22:09         ` Óscar Fuentes
2022-06-14  9:58           ` GH
2022-06-14 10:26             ` Emanuel Berg
2022-06-16  0:13 ` GH
2022-06-16  4:23   ` Emanuel Berg
2022-06-16 12:27     ` GH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).