zulip/python-zulip-api

Mastodon broken in RSSBot

maxwell-kalin opened this issue ยท 3 comments

any mastodon rss feed breaks the bot

Traceback (most recent call last):
  File "/home/zulip/rss/lib/python3.11/site-packages/feedparser/util.py", line 156, in __getattr__
    return self.__getitem__(key)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/zulip/rss/lib/python3.11/site-packages/feedparser/util.py", line 113, in __getitem__
    return dict.__getitem__(self, key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'title'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/zulip/rss/./share/zulip/integrations/rss/rss-bot", line 245, in <module>
    response: Dict[str, Any] = send_zulip(entry, feed_name)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zulip/rss/./share/zulip/integrations/rss/rss-bot", line 180, in send_zulip
    content = f"**[{entry.title}]({entry.link})**\n{strip_tags(body)}\n{entry.link}"
                    ^^^^^^^^^^^
  File "/home/zulip/rss/lib/python3.11/site-packages/feedparser/util.py", line 158, in __getattr__
    raise AttributeError("object has no attribute '%s'" % key)
AttributeError: object has no attribute 'title'

Can you give a sample URL that you're testing with?

i dont think that makes a difference but ok
https://fosstodon.org/@zulip.rss
https://fosstodon.org/tags/zulip.rss

its literally any mastodon rss link just try it

Yes, but having a specific URL will be helpful for contributors who aren't familiar with Mastodon to work on this.