summaryrefslogtreecommitdiffhomepage
path: root/w3m.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-03-26 00:13:59 +0000
committerjao <jao@gnu.org>2021-03-26 00:13:59 +0000
commit9d0308a91baea467e69916381c0f62925218387a (patch)
tree7bd0383d37067ed30bfb478a30b040c6330ba989 /w3m.org
parenta3ee0744482ff9a6fb78a9c8e0067f863720ef47 (diff)
downloadelibs-9d0308a91baea467e69916381c0f62925218387a.tar.gz
elibs-9d0308a91baea467e69916381c0f62925218387a.tar.bz2
RSS subscription generalised
Diffstat (limited to 'w3m.org')
-rw-r--r--w3m.org38
1 files changed, 1 insertions, 37 deletions
diff --git a/w3m.org b/w3m.org
index a66dd41..fd6e8da 100644
--- a/w3m.org
+++ b/w3m.org
@@ -185,42 +185,6 @@
(setq w3m-goto-article-function 'jao-w3m-browse-url)
#+END_SRC
-* Subscribe rss using r2e
- #+begin_src emacs-lisp
- (defconst jao-w3m-rss-rx
- (concat "type=\"application/\\(?:atom\\|rss\\)\\+xml\" +"
- "\\(?:title=\"\\([^\n\"]+\\)\" +\\)?href=\"\\([^\n\"]+\\)\""))
-
- (defun jao-w3m-find-rss ()
- (when (eq major-mode 'w3m-mode)
- (save-excursion
- (w3m-view-source)
- (goto-char (point-min))
- (let* ((m (re-search-forward jao-w3m-rss-rx nil t))
- (url (and m (match-string 2)))
- (title (and m (match-string 1))))
- (w3m-view-source)
- (cons url (or title ""))))))
-
- (defun jao-w3m-subscribe-rss ()
- (interactive)
- (let* ((url (or (w3m-anchor) (ffap-url-at-point)))
- (url+title (if url (cons url "") (jao-w3m-find-rss)))
- (url (car url+title))
- (title (cdr url+title)))
- (if url
- (let ((url (if (string-match "^feed:" url)
- (substring url 5) url)))
- (when (y-or-n-p (format "Subscribe to <%s>? " url))
- (let* ((name (read-string "Name: " title))
- (cat (completing-read "Category: "
- (jao-list-mailboxes "feeds")
- nil t)))
- (shell-command
- (format "r2e add %s %s jao+feeds_%s@localhost && r2e run %s"
- name url cat name)))))
- (message "No feeds found"))))
- #+end_src
* Tweeting and tooting
#+BEGIN_SRC emacs-lisp
(defun jao-w3m--toot-text (from to title)
@@ -365,6 +329,6 @@
(define-key w3m-mode-map "c" 'w3m-print-this-url)
(define-key w3m-mode-map "v" 'jao-view-video)
(define-key w3m-mode-map "V" 'w3m-download)
- (define-key w3m-mode-map "x" 'jao-w3m-subscribe-rss)
+ (define-key w3m-mode-map "x" 'jao-rss-subscribe-rss)
(define-key w3m-mode-map "Y" 'w3m-print-current-url)
#+END_SRC