;;; ycp-web.el -- My config for web related -*- lexical-binding: t -*- ;; Copyright (C) 2023 Free Software Foundation. ;; Author: Yuchen Pei ;; Package-Requires: ((emacs "28.2")) ;; This file is part of dotfiles. ;; dotfiles is free software: you can redistribute it and/or modify it under ;; the terms of the GNU Affero General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; dotfiles is distributed in the hope that it will be useful, but WITHOUT ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General ;; Public License for more details. ;; You should have received a copy of the GNU Affero General Public ;; License along with dotfiles. If not, see . ;;; Commentary: ;; My config for web related. Covers cookies, web browsing, clients to ;; web services like osm and openlibrary ;;; Code: ;; disable cookies (setq url-cookie-untrusted-urls ".*") (ignore-errors (cancel-timer url-cookie-timer)) (setq shr-cookie-policy nil) (my-package luwak (:delay 10) (:install t) (require 'luwak-org) (require 'my-utils) (setq luwak-url-rewrite-function 'my-rewrite-url) (setq luwak-tor-switch nil) ) ;;; openlibrary (my-package my-openlibrary (:delay 15)) (my-package osm (:install t) (:delay 30) (require 'my-osm) (my-keybind osm-mode-map "C-" nil "C-" nil "C-" nil "C-" nil "c" #'my-osm-show-center) (require 'osm-ol) ) (my-package url-rewrite (setq my-nitter-hosts '("nitter.net" "nitter.nixnet.services" "nitter.unixfox.eu" "nitter.mint.lgbt" "nitter.esmailelbob.xyz" "nitter.poast.org" "nitter.cz" "nitter.privacydev.net" "nitter.projectsegfau.lt" "nitter.eu.projectsegfau.lt" "nitter.in.projectsegfau.lt" "nitter.us.projectsegfau.lt" "nitter.soopy.moe" "nitter.rawbit.ninja" "nitter.d420.de" "bird.habedieeh.re" "nitter.x86-64-unknown-linux-gnu.zip" "nitter.woodland.cafe" "nitter.dafriser.be" "nitter.catsarch.com" "nitter.perennialte.ch" "nitter.salastil.com" "n.populas.no" "nt.ggtyler.dev" "nitter.uni-sonia.com" "n.opnxng.com" "nitter.ktachibana.party" "nitter.tinfoil-hat.net")) (setq my-invidious-hosts '("yewtu.be" "invidious.io.lol" "invidious.slipfox.xyz" "invidious.drgns.space" "invidious.protokolla.fi" "invidious.flokinet.to" "iv.ggtyler.dev" "yt.drgnz.club" "invidious.lunar.icu" "invidious.private.coffee" "invidious.fdn.fr" "vid.puffyan.us" "invidious.asir.dev" "onion.tube" "iv.melmac.space" "invidious.projectsegfau.lt" "inv.in.projectsegfau.lt" "invidious.privacydev.net" "iv.datura.network" "inv.tux.pizza" "iv.nboeck.de" "invidious.perennialte.ch" "yt.oelrichsgarcia.de" "inv.citw.lgbt" "inv.zzls.xyz" "invidious.einfachzocken.eu" "yt.cdaut.de" "yt.artemislena.eu" "vid.priv.au" "anontube.lvkaszus.pl" "invidious.no-logs.com")) (setq url-rw-rules '((:name ddg-result :description "duckduckgo result transform." :match (concat url-rw-www-re (rx "duckduckgo.com/l/?uddg=")) :actions ((replace-by-redirect "uddg"))) (:name google-docs-odt :description "Download Google docs document as odt." :match (concat url-rw-www-re (rx "docs.google.com/document/d/")) :actions ((replace-path-regexp "\\(/document/d/.*?\\)/.*" "\\1/export") (put-query "format" "odt"))) (:name google-to-ddg :description "Google search to duckduckgo html." :match (concat url-rw-www-re (rx "google.com/search?q=")) :actions ((replace-host "html.duckduckgo.com") (replace-path "/html"))) (:name reddit-to-old :description "Reddit to old Reddit" :match (concat url-rw-www-re (rx "reddit.com")) :actions ((replace-host "old.reddit.com"))) (:name strip-utm :description "Strip utm_* queries." :match "\\