maubot / rss

A RSS plugin for maubot
GNU Affero General Public License v3.0
69 stars 21 forks source link

Automatically Detect Feeds in HTML. #25

Open kevincox opened 3 years ago

kevincox commented 3 years ago

For example

!rss subscribe https://kevincox.ca
!rss subscribe https://www.youtube.com/c/TechnologyConnections

Should work. Instead they give an error because they try to parse the HTML as XML.

Feed discovery is a well understood process but the basics is that if you get an HTML response back you should check for links such as <link rel="alternate" type="application/rss+xml" href="{feed-url}"> in the HTML and HTTP headers. One complication is that if there are multiple feeds available the user should probably be asked which one to select.

A simple UX for selecting feed is just displaying the title and printing !rss subscribe {url} lines for the user to copy-paste. However better UX would be something like listing them with numbers and allowing the user to click a reaction to pick which feed they want to subscribe to.