Skip to content

Feed sources

Monfil uses a SourceAdapter for each source type. The source adapters cover RSS, Atom, RDF, JSON Feed, and YouTube.

User link -> resolveSource -> adapter.fetch -> parsed source -> Add Feed -> database
Stored feed -> sourceFor -> adapter.fetch -> refresh -> items -> river
\-> later image enrichment
Reader item -> content request -> article extraction -> stored body

An adapter’s fetch method returns a parsed source or a tagged error. Its parse method handles content without a network request. fetchesFullArticle tells the enrichment path whether an item link needs article extraction. The registry picks an adapter for a stored feed or a link entered in Add Feed.

  1. Extend SourceType in the shared contracts.
  2. Add an adapter and register it. Teach resolveSource to recognize its links.
  3. Give each item a stable GUID so a later refresh can find it again.
  4. Test parsing with fixtures and test fetch behavior at the adapter boundary.

Keep fields that only this source uses in feedItem.extra. When every source needs a field, add a shared column and migration.