#!/bin/sh
[ ! -f "$1" ] &&
echo "Give \`sup\` a page which has been added/updated." &&
exit 1
website="https://domain.com"
rssfile="../rss/blog.xml"
replchar='^'
link="$website/$1"
title="$(sed -n 's/
\(.*\)<\/title>/\1/Ip' "$1")"
if grep -q "$link" "$rssfile"; then
guid="$link#$(date '+%y%m%d%H%M%S')"
title="$title (Updated)"
echo "Explain the nature of the update:"
read -r content
[ -z "$content" ] && content="New updates to $link"
else
guid=$link
content="$(tr '\n' $replchar < "$1" | sed "
s/.*//
s/