Skip to content

Commit

Permalink
remove default from --topic arg, retain previous fallback behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
dimisjim committed Feb 25, 2022
1 parent b772278 commit 4de0952
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions zulip/integrations/rss/rss-bot
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ You can customize the location on the feed file and recipient stream, e.g.:
/usr/local/share/zulip/integrations/rss/rss-bot --feed-file=/path/to/my-feeds --stream=my-rss-stream
optionally, you can also specify the name of the stream topic, e.g.:
/usr/local/share/zulip/integrations/rss/rss-bot --feed-file=/path/to/my-feeds --stream=my-rss-stream --topic=my-topic-name
4. Configure a crontab entry for this script. A sample crontab entry for
processing feeds stored in the default location and sending to the default
stream every 5 minutes is:
Expand All @@ -55,7 +59,6 @@ parser.add_argument(
"--topic",
dest="topic",
help="The Stream Topic to which to send RSS messages.",
default="stream events",
action="store",
)
parser.add_argument(
Expand Down Expand Up @@ -248,7 +251,7 @@ for feed_url in feed_urls:
# entries in reverse chronological order.
break

feed_name = opts.topic
feed_name = opts.topic or data.feed.title or feed_url # type: str

response = send_zulip(entry, feed_name) # type: Dict[str, Any]
if response["result"] != "success":
Expand Down

0 comments on commit 4de0952

Please sign in to comment.