Allow multiple sequential url replacements
This commit is contained in:
parent
643ff396fe
commit
230d42c193
1 changed files with 2 additions and 2 deletions
4
uoeia
4
uoeia
|
@ -76,11 +76,11 @@ dereference() {
|
||||||
# teddit to original redd.it hosted picture
|
# teddit to original redd.it hosted picture
|
||||||
output="${1//teddit.net\/pics\/w:null_/i.redd.it/}"
|
output="${1//teddit.net\/pics\/w:null_/i.redd.it/}"
|
||||||
# nitter to twitter
|
# nitter to twitter
|
||||||
output="${1//nitter.net/twitter.com}"
|
output="${output//nitter.net/twitter.com}"
|
||||||
|
|
||||||
# custom replacements:
|
# custom replacements:
|
||||||
for rep in "${replacements[@]}"; do
|
for rep in "${replacements[@]}"; do
|
||||||
output="${1//${rep%:::*}/${rep#*:::}}"
|
output="${output//${rep%:::*}/${rep#*:::}}"
|
||||||
done
|
done
|
||||||
echo "$output"
|
echo "$output"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue