26 lines
625 B
Plaintext
26 lines
625 B
Plaintext
|
determine_protocol
|
||
|
get_domain
|
||
|
|
||
|
# check for explicit feed link
|
||
|
feed_link=`echo "$content" | grep -Po '(?<=<link href=").*?(?=" rel="alternate" type="application/atom\+xml">)' | head -1 | tr '\0' '\n'`
|
||
|
if [[ -n $feed_link ]]
|
||
|
then
|
||
|
page_ext="${protocol}${domain}${feed_link}"
|
||
|
fi
|
||
|
|
||
|
# if explicit feed link not found get user URL and add /feed.atom
|
||
|
if [[ "$page_ext" == "" ]]
|
||
|
then
|
||
|
determine_protocol
|
||
|
get_domain
|
||
|
username="${url##*//}"
|
||
|
username="${username#*/}"
|
||
|
|
||
|
if [[ "$username" == users/* ]]
|
||
|
then
|
||
|
username="${username#*/}"
|
||
|
username="users/${username%%/*}"
|
||
|
page_ext="${protocol}${domain}/${username}/feed.atom"
|
||
|
fi
|
||
|
fi
|