zulip / python-zulip-api

Python library for the Zulip API.
https://zulip.com/api/
Apache License 2.0
364 stars 368 forks source link

rss-bot: Custom topic configuration #785

Closed danteu closed 1 year ago

danteu commented 1 year ago

rss-bot selects the topic of its RSS notification messages based on the topic of the RSS feed. Monitoring a large number of RSS feeds therefore leads to a large number of topics in the stream. Also, the user has no option to customize the topic names.

This patch adds a new --subject argument that replaces the topic for all RSS feed notifications with the provided string. If no custom topic is provided, the bot uses the default behaviour described above.

timabbott commented 1 year ago

Let's change it to --topic; otherwise lgtm.

(subject is a legacy API internals name that we don't want to expose to users as we're trying to get rid of it).

danteu commented 1 year ago

Let's change it to --topic; otherwise lgtm.

(subject is a legacy API internals name that we don't want to expose to users as we're trying to get rid of it).

Done. Also shortened the assignment in line 193.

timabbott commented 1 year ago

I pushed back here after adjusting the --help text to update the defaults. I also wonder whether zulip/integrations/rss/requirements.txt is supposed to have feedparser in it -- I needed to install that module to run this with --help.

danteu commented 1 year ago

I also wonder whether zulip/integrations/rss/requirements.txt is supposed to have feedparser in it -- I needed to install that module to run this with --help.

Yes, I had to manually install feedparser as well. Should I add that in a commit or open a seperate PR? Other integrations such as google-calendar also seem to have incomplete requirement files.

timabbott commented 1 year ago

Merged. A separate PR would be great, thanks!