Geminisphere via backlinks
Message headers
From: Plain Text <text@sdfeu.org>
Subject: Geminisphere via backlinks
Date: Sat, 26 Feb 2022 20:23:45 -0000 (UTC)
Message-ID: <sve28h$dgg$1@dont-email.me>
Message content
Got a proof-of-concept working of a pingback script that accepts
URLs (backlinks) of reply posts and checks the remote content for
a => link to one's capsule before appending the URL to the list of
received replies.
Maybe others want to expand on that for their own pleasure.
Cheers
On 2020-11-13, in the mailing list:
If clients would send referers, servers could collect (cache) and
present those to clients asking for links _to_ the current page
("backlinks" in wiki parlance), thus creating an interconnected gemini
sphere.
>
Although not simple, I would enjoy bi-directional linking in Gemini.
--
https://lists.sr.ht/~adnano/gemini/
%3C157076343ad69ee6833f16684b5a0c2f%40sdfeu.org%3E
--
###!/bin/bash
### URL of own capsule (grep string for mention)
capsule="gemini://gemini.capsule/~username/"
### Local file to append received reply URLs (chmod?)
replies="/home/username/public_gemini/replies.gmi"
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
if [[ -n $QUERY_STRING ]]; then
printf "20 text/gemini\r\n"
echo "# Thank you"
urlraw="$QUERY_STRING"
url=$(urldecode "$urlraw")
echo "Received the following reply URL:"
echo '```'
echo "$url"
echo '```'
domainpart=$(echo "$url"|awk -F/ '{print $3}')
echo "Trying to retrieve your reply content to check for the mention ..."
echo "Links back to my capsule found mentionend in your reply content:"
echo "$url" | openssl s_client -crlf -quiet -ign_eof -connect
"$domainpart:1965" \
| grep "^=> $capsule"
if [[ $? -eq 0 ]]; then
echo
echo "Adding your URL to my list of received replies, thanks!"
echo "=> $url $(date "+%F %T")" >> "$replies"
else
echo "Could not find a link back to my capsule (or had other issues)."
fi
else
printf "10 Please Enter Gemini URL of Your Reply\r\n"
fi
## Related
Children:
=> j814l7Fhsa6U1@mid.individual.net.gmi Re: Geminisphere via backlinks (by Andy Burns on Sun, 27 Feb 2022 11:12:38 +0000)
=> 87v8x0lc8x.fsf@kalayaan.xyz.gmi Re: Geminisphere via backlinks (by rtr on Sun, 27 Feb 2022 20:34:06 +0800)
=> t2mtup$1fdr$1@gioia.aioe.org.gmi Re: Geminisphere via backlinks (by Vasco Costa on Thu, 7 Apr 2022 14:54:17 -0000 (UTC))