X-Git-Url: https://software.frrobert.com/lace/blobdiff_plain/7c6c6abf41f724929802185a43362267a5c90529..64396bf88321c2592088dcd0c50e45b25d5d8180:/laced diff --git a/laced b/laced index 3a855f5..91314a4 100755 --- a/laced +++ b/laced @@ -90,19 +90,22 @@ function timeline() { url="$url/" fi domain=$(sed 's/\/.*$//' <<< "$domain") - fav=$(timeout $connectto openssl s_client -crlf -quiet -connect "$domain:1965" <<<"gemini://$domain/favicon.txt" 2>/dev/null | sed -e '1d') + timeout $connectto openssl s_client -crlf -quiet -connect "$domain:1965" <<<"$url" 2>/dev/null > $tmpfile3 timeoutstatus=${PIPESTATUS[0]} if [ $timeoutstatus -ne 124 ];then - if [ ! -z "$fav" ];then - user="$fav $user" - fi - timeout $connectto openssl s_client -crlf -quiet -connect "$domain:1965" <<<"$url" 2>/dev/null > $tmpfile3 - local newuser=$(cat $tmpfile3 | sed -n '/# /{n;p;}' | grep -e author | awk '{print $2}' ) - local newavatar=$(cat $tmpfile3 | sed -n '/# /{n;n;p;}' | grep -e avatar | awk '{print $2}' ) + local newuser=$(cat $tmpfile3 | grep -m 1 author: | awk -F ":" '{print $2}' ) + local newavatar=$(cat $tmpfile3 | grep -m 1 avatar: | awk -F ":" '{print $2}' ) if [[ $newuser != "" ]] then - - user="$newavatar $newuser" + newuser=$(echo "$newuser" | xargs) + newavatar=$(echo "$newavatar" | xargs) + user="$newavatar $newuser" + else + fav=$(timeout $connectto openssl s_client -crlf -quiet -connect "$domain:1965" <<<"gemini://$domain/favicon.txt" 2>/dev/null | sed -e '1d') +if [ ! -z "$fav" ];then + user="$fav $user" + fi + fi @@ -129,6 +132,7 @@ function timeline() { wordcount="$(wc -c $tmpfile | awk '{print $1}')" if [[ "$wordcount" > 100 ]]; then cp $tmpfile $config_place/microblogs.gmi + cp $tmpfile /mnt/geminiserver/gemini/lace.gmi else sed -i '1i Laced could not connect to the Internet showing previous download' $config_place/microblogs.gmi