I wrote the following and tested it to work on several articles. This may be a good starting point for you.
(defun gnus-article-extract-url-into-buffer () (interactive) (let ((simple-url-regexp "https?://") urls) (save-excursion ;; collect text URLs (while (search-forward-regexp simple-url-regexp nil t) (when-let (url (thing-at-point 'url)) (setq urls (cons url urls)))) (beginning-of-buffer) ;; collect widget URLs (while (not (eobp)) (goto-char (next-overlay-change (point))) (when-let (link (get-text-property (point) 'gnus-string)) (and (string-match simple-url-regexp link) (setq urls (cons link urls)))) (goto-char (next-overlay-change (point))))) (when urls (switch-to-buffer-other-window "*gnus-article-urls*") (dolist (url urls) (insert url)) (beginning-of-buffer))))
I must clarify that this is intended to be run from the article buffer. Also, I might have missed the point by taking what you said literally about starting a new buffer containing URLs, in which case you can change the last form to:
(when urls (dolist (url urls) (browse-url url)))
Or, Tyler's approach is simpler if you don't need to parse widget URLs.
source share