diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2021-04-07 11:46:50 -0400 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2021-04-07 11:46:50 -0400 |
| commit | afaca0a0b66eada1ba3662946d1c2866ae7d2ed8 (patch) | |
| tree | a4e3d987f41af4b99521482008175e452bf0103e /.local/bin/rssadd | |
| parent | 20c1eada6fe019aa9673e2570db40f5d4d4743dd (diff) | |
| download | eibhear-afaca0a0b66eada1ba3662946d1c2866ae7d2ed8.tar.gz eibhear-afaca0a0b66eada1ba3662946d1c2866ae7d2ed8.tar.zst eibhear-afaca0a0b66eada1ba3662946d1c2866ae7d2ed8.zip | |
here string removed
Diffstat (limited to '.local/bin/rssadd')
| -rwxr-xr-x | .local/bin/rssadd | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/.local/bin/rssadd b/.local/bin/rssadd index fb60be8..910fca3 100755 --- a/.local/bin/rssadd +++ b/.local/bin/rssadd @@ -1,12 +1,12 @@ #!/bin/sh -if echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null; then +if echo "$1" | grep -q "https*://\S\+\.[A-Za-z]\+\S*" ; then url="$1" else url="$(grep -Eom1 '<[^>]+(rel="self"|application/[a-z]+\+xml)[^>]+>' "$1" | - sed -E 's_^.*href="(https?://[^"]+)".*$_\1_')" + grep -o "https?://[^\" ]")" - ! grep "https*://\S\+\.[A-Za-z]\+\S*" <<<"$url" && + echo "$url" | grep -q "https*://\S\+\.[A-Za-z]\+\S*" || notify-send "That doesn't look like a full URL." && exit 1 fi |
