[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/luwak 9c95bcb74f 27/28: adding an example url rewrite f
From: |
ELPA Syncer |
Subject: |
[elpa] externals/luwak 9c95bcb74f 27/28: adding an example url rewrite function |
Date: |
Tue, 25 Oct 2022 15:57:55 -0400 (EDT) |
branch: externals/luwak
commit 9c95bcb74ffccbbc50a529dbbec81e24ddce6baf
Author: Yuchen Pei <hi@ypei.me>
Commit: Yuchen Pei <hi@ypei.me>
adding an example url rewrite function
---
luwak.el | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/luwak.el b/luwak.el
index 08eb7931ff..93b3d0fd0d 100644
--- a/luwak.el
+++ b/luwak.el
@@ -364,6 +364,17 @@ When non-nill, swap the tor-switch in prefix-arg effect."
(write-file file-name)))
(message "Wrote %s." file-name))
+;; Example url rewrite function
+(defun luwak-rewrite-ddg-result (url)
+ "Rewrites ddg result url to save one jump."
+ (let ((new-url url))
+ (when (string-match
+ "^https://duckduckgo.com/l/\\?uddg=\\(.*\\)&rut=.*$" url)
+ (setq new-url (url-unhex-string (match-string 1 url))))
+ (unless (equal url new-url)
+ (message "Rewriting %s to %s" url new-url))
+ new-url))
+
(provide 'luwak)
;;; luwak.el ends here
- [elpa] externals/luwak 179461ba0e 14/28: adding link rendering toggle, (continued)
- [elpa] externals/luwak 179461ba0e 14/28: adding link rendering toggle, ELPA Syncer, 2022/10/25
- [elpa] externals/luwak 12692b1207 05/28: adding gitignore, ELPA Syncer, 2022/10/25
- [elpa] externals/luwak 9341d7ac6b 01/28: initial commit, ELPA Syncer, 2022/10/25
- [elpa] externals/luwak 39ac2162c5 02/28: adding luwak-mode, ELPA Syncer, 2022/10/25
- [elpa] externals/luwak 4b0acd3441 09/28: moving luwak-mode-map definition to be above the mode definition, ELPA Syncer, 2022/10/25
- [elpa] externals/luwak f08e3189eb 12/28: Caching dump for history nav, ELPA Syncer, 2022/10/25
- [elpa] externals/luwak f12c63b8a5 16/28: render a dump buffer, ELPA Syncer, 2022/10/25
- [elpa] externals/luwak 08855c83c4 24/28: minor wording, ELPA Syncer, 2022/10/25
- [elpa] externals/luwak 96fec3bce0 23/28: minor rewording, ELPA Syncer, 2022/10/25
- [elpa] externals/luwak 91764c44b9 22/28: updated readme, ELPA Syncer, 2022/10/25
- [elpa] externals/luwak 9c95bcb74f 27/28: adding an example url rewrite function,
ELPA Syncer <=
- [elpa] externals/luwak ec97058718 28/28: minor docstring, ELPA Syncer, 2022/10/25
- [elpa] externals/luwak 544187e3e7 26/28: fixed a bug when no title could be guessed., ELPA Syncer, 2022/10/25
- [elpa] externals/luwak fa9a801f81 04/28: licensing and readme, ELPA Syncer, 2022/10/25