1
0
Fork 0

Add support for paste.centos.org to readwwwlog

This commit is contained in:
tastytea 2022-04-26 17:53:18 +02:00
parent 62d929127f
commit 450ef82d9b
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 6 additions and 4 deletions

View File

@ -21,20 +21,21 @@ local default_cmd="firefox"
local termopts=""
for url in ${urls}; do
local id=${url##*/} # Most paste services have the ID as the last element
if [[ ${url} =~ 'dpaste\.com' && ! ${url[-4,-1]} == ".txt" ]]; then
url+=".txt"
elif [[ ${url} =~ 'pastebin\.com' && ! ${url} =~ '/raw/' ]]; then
local id=${url##*/}
url="https://pastebin.com/raw/${id}"
elif [[ ${url} =~ 'irccloud\.com' && ! ${url} =~ '/raw/' ]]; then
local id=${${(@s:/:)url}[4]}
id=${${(@s:/:)url}[4]}
url="https://www.irccloud.com/pastebin/raw/${id}"
elif [[ ${url} =~ 'bpa\.st' && ! ${url} =~ '/download-archive/' ]]; then
local id=${url##*/}
url="https://bpa.st/download-archive/${id}"
elif [[ ${url} =~ 'paste\.debian\.net' && ! ${url} =~ '/plain/' ]]; then
local id=${url##*/}
url="https://paste.debian.net/plain/${id}"
elif [[ ${url} =~ 'paste\.centos\.org' && ! ${url} =~ '/raw/' ]]; then
url="https://paste.centos.org/view/raw/${id}"
fi
if [[ ${TERMINAL} =~ "alacritty|xfce4-terminal" ]]; then

View File

@ -32,6 +32,7 @@ local -A assignments=(
'^https?://bpa\.st/' "readwwwlog"
'^https?://sprunge\.us/' "readwwwlog"
'^https?://paste\.debian\.net/' "readwwwlog"
'^https://paste\.centos\.org/' "readwwwlog"
'\.(webm|png|jpe?g|gif|svg|bmp|xcf)(\?.+)?$' "openwwwimg"
'(^magnet:|\.torrent$)' "transmission-remote-gtk"
)