matrix-org/matrix-hookshot

[RSS bot] Support <comments>

opk12 opened this issue · 1 comments

opk12 commented

While <link> is the main news URL, <comments> is the optional URL of the comments associated with the news. https://www.rssboard.org/rss-specification#ltcommentsgtSubelementOfLtitemgt

What about a variable $COMMENTS to expose it?

Additional context

Lemmy is like Reddit, a forum that associates a discussion thread with an optional (external, non-Lemmy) news URL. I have not checked Reddit yet, but in Lemmy

  1. the URL of a discussion thread with a news goes into <comments> and the news URL goes into <link>;
  2. the URL of a discussion thread without a news goes into <comments> and <link>.

This is an explicit decision at Lemmy, in light of the RSS spec linked above.

For example, today this community has È online l'Archivio... for case 1 and Sono stati pubblicati gli Atti... for case 2, and its RSS is here.

Use case

At our community (OpenStreetMap Italia), we want Matrix to always see the discussion thread. It provides context and clarification, and the news URL itself may already have been mentioned in the chat anyway. The Lemmy interface makes it easy to reach the news article from the discussion thread (just click the thread title) but clearly the inverse is not possible (the news artcle is not aware of Lemmy).

Thanks for creating an issue, this should be trivial to do. Essentially this is modifying https://github.com/matrix-org/matrix-hookshot/blob/main/src/feeds/parser.rs to return a comments entry (and https://github.com/matrix-org/matrix-hookshot/blob/main/src/feeds/FeedReader.ts#L51), and then a switch in https://github.com/matrix-org/matrix-hookshot/blob/main/src/Connections/FeedConnection.ts#L150.

If someone wants to pick this up as a PR, then it would be massively appreciated. Otherwise, it'll be whenever I next have a window to work on Hookshot.