python-zulip-api icon indicating copy to clipboard operation
python-zulip-api copied to clipboard

rss-bot: Added a hash to the end of the feed_file

Open anon1a7d opened this issue 11 months ago • 3 comments

This allows for more than one feed per domain name (netloc). Previously, only a single feed could be associated with a domain name as the feed_file kept in the cache (data-dir) was simply the domain name (netloc). Using shake128, added an 8 digit hash (4 bytes in hex) of the full URL to the end of the feed_file name.

Now can support https://example.com/site_one/feed.rss and https://example.com/site_two/feed.rss, etc.

The files in the data-dir for these two URLs will be as follows.

example.com-7778e2bd
example.com-52cfce4c

How did you test this PR?

Ran the modified code manually from a tmp environment (including a unique data-dir). Confirmed cached feed_files were as expected. Messages successfully sent to test stream under proper topics.

anon1a7d avatar Dec 19 '24 20:12 anon1a7d

Is there an issue this PR is solving? Please link it if so.

alya avatar Jan 07 '25 00:01 alya

Is there an issue this PR is solving? Please link it if so.

There is not. It's something I noticed when I tried to use rss-bot to pull in two different feeds from a single domain.

anon1a7d avatar Jan 07 '25 13:01 anon1a7d

@Niloth-p can you review this?

timabbott avatar Jan 07 '25 21:01 timabbott