Skip to content

Commit

Permalink
[scripts] ,linkify: notify once link is generated
Browse files Browse the repository at this point in the history
  • Loading branch information
meain committed Sep 7, 2024
1 parent 65d3b1c commit 8607603
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/.local/bin/random/,linkify
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ elif echo "$url" | grep -qE '^https://teams.microsoft.com'; then
channel="$(echo "$url" | grep -o 'channelName=[^&]*' | cut -d= -f2)"
printf "[Teams message in %s](%s)" "$team#$channel" "$url"
else
title="$(get_title "$url")"
title="$(get_title "$url" | sed 's| - YouTube$||')"
[ -z "$title" ] && title="$url"
printf "[%s](%s)" "$title" "$url"
fi | tee /dev/stderr | pbcopy
fi | tee /tmp/linkify | pbcopy

title="$(cat /tmp/linkify | sed 's|.*\[\(.*\)\](.*)|\1|')"
notify "$title" "$url"
cat /tmp/linkify

0 comments on commit 8607603

Please sign in to comment.