Skip to content

Commit 4bd9b4a

Browse files
committed
Change: Use org-web-tools to get archive.is URLs
1 parent 9341157 commit 4bd9b4a

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

README.org

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,25 +2265,18 @@ CLOSED: [2017-08-03 Thu 15:11]
22652265
:ID: a0e9486f-24f0-47a6-8f21-50bcc7ac2ca0
22662266
:END:
22672267
:LOGBOOK:
2268+
- Note taken on [2018-11-24 Sat 10:44] \\
2269+
Using =org-web-tools= instead of the Python script.
22682270
- State "DONE" from "TODO" [2017-08-03 Thu 15:11]
22692271
:END:
22702272

2271-
This bookmarklet should provide a way to get the URL:
2272-
2273-
#+BEGIN_SRC javascript
2274-
javascript:void(open('https://archive.today/?run=1&url='+encodeURIComponent(document.location)))
2275-
#+END_SRC
2276-
2277-
Seems to only work if run in a browser, with JavaScript. But there's a [[https://github.com/pastpages/archiveis][Python package]] that has a shell command. So:
2278-
22792273
#+BEGIN_SRC elisp :results silent
2280-
(require 's)
2274+
(require 'org-web-tools)
22812275

22822276
(defun emacs-package-dev-handbook--archiveis-capture (url)
22832277
"Return archive.is archived URL for URL."
2284-
(with-temp-buffer
2285-
(when (zerop (call-process "archiveis" nil t nil url))
2286-
(s-trim (buffer-string)))))
2278+
(when-let* ((id (org-web-tools-archive--url-id url)))
2279+
(format "http://%s/%s" org-web-tools-archive-hostname id)))
22872280

22882281
(cl-defun emacs-package-dev-handbook-insert-archiveis-property (url)
22892282
"Set the \"archive.is\" property for entry at point to the archived version of URL.

0 commit comments

Comments
 (0)