Skip to content

Commit

Permalink
Merge pull request #116 from torgeir/main
Browse files Browse the repository at this point in the history
Make summarize webpage support shr urls at point
  • Loading branch information
s-kostyaev authored May 13, 2024
2 parents 87fc300 + 6e2ef52 commit 6d4bef6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ellama.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
(require 'llm)
(require 'spinner)
(require 'info)
(require 'shr)
(eval-when-compile (require 'rx))

(defgroup ellama nil
Expand Down Expand Up @@ -1426,11 +1427,13 @@ buffer."
(defun ellama-summarize-webpage (url)
"Summarize webpage fetched from URL.
Summarize the URL at point if `thing-at-point' is present, otherwise
prompt user for URL to summarize."
Summarize the URL at point if `thing-at-point' is present, or using
`shr-url-at-point' if a URL is at point in modes like `eww' or `elfeed',
otherwise prompt user for URL to summarize."
(interactive
(list
(if-let ((url (and (fboundp 'thing-at-point) (thing-at-point 'url))))
(if-let ((url (or (and (fboundp 'thing-at-point) (thing-at-point 'url))
(shr-url-at-point nil))))
url
(read-string "Enter URL you want to summarize: "))))
(let ((buffer-name (url-retrieve-synchronously url t)))
Expand Down

0 comments on commit 6d4bef6

Please sign in to comment.