summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gemfeed.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/gemfeed.py b/gemfeed.py
index ca9b556..5b1e68c 100644
--- a/gemfeed.py
+++ b/gemfeed.py
@@ -36,10 +36,16 @@ def main():
# Parse arguments
parser = argparse.ArgumentParser(description='Generate an Atom feed for Gemini content.')
+ parser.add_argument('-a', '--author', dest='author', type=str,
+ help="feed author's name")
parser.add_argument('-b', '--base', dest='base_url', type=str,
required=True, help='base URL for feed and entries')
+ parser.add_argument('-e', '--email', dest='email', type=str,
+ help="feed author's email address")
parser.add_argument('-o', '--output', dest='output', type=str,
default="atom.xml", help='output filename')
+ parser.add_argument('-s', '--subtitle', dest='subtitle', type=str,
+ help='feed subtitle')
parser.add_argument('-t', '--title', dest='title', type=str,
default="A Gemini feed", help='feed title')
args = parser.parse_args()
@@ -54,6 +60,15 @@ def main():
feed = FeedGenerator()
feed.id(args.base_url)
feed.title(args.title)
+ if args.subtitle:
+ feed.subtitle(args.subtitle)
+ author = {}
+ if args.author:
+ author["name"] = args.author
+ if args.email:
+ author["email"] = args.email
+ if author:
+ feed.author(author)
feed.link(href=args.base_url, rel='alternate')
feed.link(href=args.base_url + args.output, rel='self')