Fixed some weirdness in the link title trigger.
This commit is contained in:
parent
5471396992
commit
a0553d8378
@ -3,7 +3,7 @@
|
|||||||
curl="$(command -v curl) --connect-timeout 5"
|
curl="$(command -v curl) --connect-timeout 5"
|
||||||
for l in $3 ; do
|
for l in $3 ; do
|
||||||
if [[ "${l#:}" =~ http://|https://|www\.*\.* ]]; then
|
if [[ "${l#:}" =~ http://|https://|www\.*\.* ]]; then
|
||||||
pageTitle="$($curl -Ls "${l#:}" | grep "<title>" | html2text | tr -s '[:space:]' ' ')"
|
pageTitle="$($curl -Ls "${l#:}" | sed -n 's/<title>\(.*\)<\/title>/\1/p' | head -1 | html2text | tr -s '[:space:]' ' ')"
|
||||||
shortLink="${l#*://}"
|
shortLink="${l#*://}"
|
||||||
shortLink="${shortLink%%/*}"
|
shortLink="${shortLink%%/*}"
|
||||||
if [ ${#pageTitle} -gt 1 ]; then
|
if [ ${#pageTitle} -gt 1 ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user