This repository has been archived on 2021-11-29. You can view files and clone it, but cannot push or open issues or pull requests.
rsstube-bash-old/scripts/url-extractors/tumblr

32 lines
532 B
Plaintext

# not all Tumblr blogs support HTTPS
determine_protocol
get_domain
# require subdomain
if [[ $domain == "tumblr.com" ]]
then
error "Must be on a subdomain, e.g., username.tumblr.com"
fail
fi
# cut off end of page thing that gets appended sometimes
page=${url%%'#_=_'}
# cut off trailing slash if present (to prevent duplicates)
page=${page%%/}
# strip domain
page=${page##*tumblr.com}
page=${page##/}
# get rss
if [[ -n $page ]]
then
rss=${protocol}${domain}/${page}/rss
else
rss=${protocol}${domain}/rss
fi
url_ext=$rss