diff options
Diffstat (limited to 'emacs/.emacs.d/lisp/my/my-web.el')
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-web.el | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-web.el b/emacs/.emacs.d/lisp/my/my-web.el index f2e48ba..472cab6 100644 --- a/emacs/.emacs.d/lisp/my/my-web.el +++ b/emacs/.emacs.d/lisp/my/my-web.el @@ -137,20 +137,29 @@ ;;; webgetter (require 'my-net) -(defun my-open-spectator-au (url &optional no-overwrite) - (interactive "sspectator.com.au link: ") - (let ((url-request-extra-headers '(("X-Forwarded-For" . "66.249.66.1"))) - (url-user-agent "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)")) - (let ((file-name - (if no-overwrite - (my-make-unique-file-name - (my-make-file-name-from-url url) - my-download-dir) - (expand-file-name +(defun my-fetch-browse (url &optional no-overwrite) + "Fetch URL to a local file then browse it with firefox. + +Useful for bypassing \"Enable JavaScript and cookies to continue\"." + (interactive "sUrl to fetch and browse: ") + (let ((file-name + (if no-overwrite + (my-make-unique-file-name (my-make-file-name-from-url url) - my-download-dir)))) - (url-copy-file url file-name (not no-overwrite)) - (browse-url-firefox (format "file://%s" file-name))))) + my-download-dir) + (expand-file-name + (my-make-file-name-from-url url "html") + my-download-dir)))) + (url-copy-file url file-name (not no-overwrite)) + (browse-url-firefox (format "file://%s" file-name)))) + +(defun my-fetch-browse-as-googlebot (url &optional no-overwrite) + "Same as `my-fetch-browse', but spoofing googlebot. + +Useful for bypassing some paywalls." + (interactive "sUrl to fetch and browse as googlebot: ") + (my-url-as-googlebot + (my-fetch-browse url no-overwrite))) (defun my-mastodon-url-p (url) "Guess if a url is a mastodon post. |