aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2021-02-10 19:33:25 -0300
committerSilvio Rhatto <rhatto@riseup.net>2021-02-10 19:33:25 -0300
commit167f0bfe438530e555fbcf9894d86ded3ef727af (patch)
tree4bd51c4e536743b01f612693d5acaae3fc36d2e5
parentd7515f6130879773875d7b3fd0612db86139d0df (diff)
downloadscripts-167f0bfe438530e555fbcf9894d86ded3ef727af.tar.gz
scripts-167f0bfe438530e555fbcf9894d86ded3ef727af.tar.bz2
Scuttle: fix title fetching
-rwxr-xr-xscuttle3
1 files changed, 2 insertions, 1 deletions
diff --git a/scuttle b/scuttle
index 22dd3c9..cb94ae1 100755
--- a/scuttle
+++ b/scuttle
@@ -49,7 +49,8 @@ CALL="$CALL&tags=$TAGS"
# Description
if [ -z "$DESC" ]; then
- DESC="`torify curl -s $URL | grep -i "<title>" | sed -e 's|<title>\(.*\)</title>|\1|' 2> /dev/null`"
+ # See http://stackoverflow.com/questions/3195851/ddg#3195895
+ DESC="`torify curl -s $URL | grep -i "<title>" | sed -n 's/.*<title>\(.*\)<\/title>.*/\1/ip;T;q' 2> /dev/null`"
echo "Fetched description: $DESC"
fi