From af7351e6c33e891344724968f88f3f62d0f3275c Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Tue, 3 Nov 2020 18:29:44 +0100 Subject: Jot down POC code to retrieve a Message-ID from a URL Retrieved from: (Aka <87eeml80oi.fsf@gmail.com>) --- itches/emacs/development.org | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'itches/emacs/development.org') diff --git a/itches/emacs/development.org b/itches/emacs/development.org index a1fe3f2..a3e05da 100644 --- a/itches/emacs/development.org +++ b/itches/emacs/development.org @@ -46,6 +46,23 @@ trick, e.g. &submit=Search! &idxname=$LIST #+end_example + ⇒ + #+begin_src elisp + (defun mhonarc-to-messageid (url) + "Retrieve the Message-ID from an article archived on MHonArc." + (interactive + (list + (let* ((default (or (thing-at-point-url-at-point) + (and (derived-mode-p 'eww-mode) + (shr-url-at-point nil)))) + (prompt (if default + (format "URL? (%s) " default) + "URL? "))) + (read-string prompt nil nil default)))) + (with-current-buffer (url-retrieve-synchronously url) + (search-forward-regexp "^$") + (message (xml-substitute-numeric-entities (match-string 1))))) + #+end_src - public-inbox: trivial *** TODO HTTP archive → Message-ID - : cf. =X-Message-Id= comment in HTML -- cgit v1.2.3