64 lines
1.6 KiB
Plaintext
64 lines
1.6 KiB
Plaintext
|
supported_sites=(
|
||
|
"hugo"
|
||
|
"invidious"
|
||
|
"mastodon"
|
||
|
"nitter"
|
||
|
# "peertube"
|
||
|
"pleroma"
|
||
|
"plume"
|
||
|
"writefreely"
|
||
|
)
|
||
|
|
||
|
hugo=(
|
||
|
'<meta name=(")?generator(")? content="Hugo [0-9]{1,}.[0-9]{1,}.[0-9]{1,}"( )?(/)?>'
|
||
|
)
|
||
|
|
||
|
invidious=(
|
||
|
'<link title="Invidious" type="application/opensearchdescription\+xml" rel="search" href="/opensearch.xml">'
|
||
|
)
|
||
|
|
||
|
mastodon=(
|
||
|
"<div class='column-1'>\n<h4>Developers</h4>\n<ul>\n<li><a href=\"https://docs.joinmastodon.org/\">Documentation</a></li>\n<li><a href=\"https://docs.joinmastodon.org/api/guidelines/\">API</a></li>\n</ul>\n</div>"
|
||
|
)
|
||
|
|
||
|
nitter=(
|
||
|
'<meta property="og:site_name" content="Nitter"></meta>'
|
||
|
)
|
||
|
|
||
|
# note: we can identify PeerTube, but I don't know how to get the feed yet
|
||
|
#peertube=(
|
||
|
# '<meta property="og:platform" content="PeerTube" />'
|
||
|
#)
|
||
|
|
||
|
pleroma=(
|
||
|
'<noscript>To use Pleroma, please enable JavaScript.</noscript>'
|
||
|
'<title>Pleroma</title>'
|
||
|
)
|
||
|
|
||
|
plume=(
|
||
|
'<div>\n <h3>Plume [0-9]{1,}.[0-9]{1,}.[0-9]{1,}</h3>\n <a href="https://docs.joinplu.me">Documentation</a>\n <a href="https://github.com/Plume-org/Plume">Source code</a>\n <a href="https://riot.im/app/#/room/#plume:disroot.org">Matrix room</a>\n </div>'
|
||
|
)
|
||
|
|
||
|
writefreely=(
|
||
|
'<meta name="generator" content="Write.as">'
|
||
|
'<meta name="generator" content="WriteFreely">'
|
||
|
)
|
||
|
|
||
|
for possible_site in ${supported_sites[@]}
|
||
|
do
|
||
|
declare -n possible_patterns="$possible_site"
|
||
|
for pattern in "${possible_patterns[@]}"
|
||
|
do
|
||
|
site_pattern_match=`echo "$content" | grep -Pzo "$pattern" | tr '\0' '\n'`
|
||
|
if [[ -n "$site_pattern_match" ]]
|
||
|
then
|
||
|
site="$possible_site"
|
||
|
break
|
||
|
fi
|
||
|
done
|
||
|
if [[ -n "$site" ]]
|
||
|
then
|
||
|
break
|
||
|
fi
|
||
|
done
|