all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: GH <project@gnuhacker.org>
To: Help GNU Emacs <help-gnu-emacs@gnu.org>
Subject: functions to download mailing list archives
Date: Mon, 13 Jun 2022 00:30:00 +0200	[thread overview]
Message-ID: <87r13tikgn.fsf@gnu.org> (raw)


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?



             reply	other threads:[~2022-06-12 22:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-12 22:30 GH [this message]
2022-06-12 23:04 ` functions to download mailing list archives Ó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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r13tikgn.fsf@gnu.org \
    --to=project@gnuhacker.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.