From: dick <dick.r.chiang@gmail.com>
To: Sam Steingold <sds@gnu.org>
Cc: ding@gnus.org
Subject: Re: hackernews & gnus-summary-browse-url
Date: Tue, 08 Mar 2022 11:35:36 -0500 [thread overview]
Message-ID: <875yoofllz.fsf@dick> (raw)
In-Reply-To: <lzsfrso56r.fsf@3c22fb11fdab.ant.amazon.com> (Sam Steingold's message of "Tue, 08 Mar 2022 10:05:32 -0500")
Not exactly what you want, but close enough:
(add-hook
'gnus-summary-mode-hook
(lambda ()
(require 'url-http)
(defvar url-http-end-of-headers)
(when (equal (gnus-group-real-name gnus-newsgroup-name)
"gwene.com.ycombinator.news")
(make-local-variable 'gnus-article-prepare-hook)
(add-to-list
'gnus-article-prepare-hook
(lambda ()
(when (and (buffer-live-p (get-buffer gnus-original-article-buffer))
(buffer-live-p (get-buffer gnus-article-buffer)))
(with-current-buffer gnus-original-article-buffer
(when-let ((found (re-search-forward
"\"\\([^\"]+\\)\">Comments"
nil t))
(url (match-string 1))
(resbuf (url-retrieve-synchronously url t nil 5)))
(unwind-protect
(with-current-buffer gnus-article-buffer
(let ((inhibit-read-only t))
(message-goto-body)
(save-excursion (delete-region (point) (point-max)))
(shr-insert-document
(with-current-buffer resbuf
(libxml-parse-html-region (1+ url-http-end-of-headers)
(point-max))))))
(kill-buffer resbuf))))))))))
prev parent reply other threads:[~2022-03-08 16:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-07 21:44 Sam Steingold
2022-03-07 23:40 ` Eric Abrahamsen
2022-03-08 15:05 ` Sam Steingold
2022-03-08 15:23 ` Lars Ingebrigtsen
2022-03-08 15:56 ` Eric Abrahamsen
2022-03-08 15:58 ` Lars Ingebrigtsen
2022-03-08 20:50 ` Sam Steingold
2022-03-09 12:04 ` Lars Ingebrigtsen
2022-03-09 19:41 ` Sam Steingold
2022-03-09 19:50 ` Eric Abrahamsen
2022-03-09 21:20 ` Sam Steingold
2022-03-12 17:38 ` Lars Ingebrigtsen
2022-03-08 16:35 ` dick [this message]
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=875yoofllz.fsf@dick \
--to=dick.r.chiang@gmail.com \
--cc=ding@gnus.org \
--cc=sds@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.
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 NNTP newsgroup(s).