all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.