########################## Read an RSS or Atom feed ########################## Pull the items out of a syndication feed with :func:`turbohtml.extract.feed`, the ``feedparser`` successor. It detects the format -- RSS 2.0, Atom 1.0, or RDF/RSS 1.0 -- from the root element and normalizes every item into one shape, so the same code reads an Atom ```` and an RSS ````: .. testcode:: from turbohtml.extract import feed parsed = feed( '' "Widgets Weeklyhttps://widgets.example/" "Cogs ship Tuesdayhttps://widgets.example/cogs" "tag:widgets,2026:cogs" "Tue, 07 Jul 2026 09:00:00 GMT" "The cogs are ready." "" ) print(parsed.type, parsed.title) entry = parsed.entries[0] print(entry.title, "->", entry.link) print(entry.published) .. testoutput:: rss Widgets Weekly Cogs ship Tuesday -> https://widgets.example/cogs Tue, 07 Jul 2026 09:00:00 GMT A :class:`~turbohtml.extract.Feed` carries the feed's ``type``, ``title``, ``link``, ``description``, and ``updated`` plus its ``entries``, each an :class:`~turbohtml.extract.Entry` whose ``title``, ``link``, ``id``, ``updated``/``published``, ``summary``/``content``, and ``author`` are the first present value across the format's spellings. Timestamps come back verbatim, so parse them with your own date library when you need a ``datetime``. The same call reads an Atom feed without a change in the reading code, because the field names are normalized: .. testcode:: parsed = feed( '' "Widgets Weekly" "Gears in stock" '' "tag:widgets,2026:gears" "2026-07-07T09:00:00Z" ) print(parsed.type) print(parsed.entries[0].title, "->", parsed.entries[0].link) .. testoutput:: atom Gears in stock -> https://widgets.example/gears :func:`~turbohtml.extract.feed` returns ``None`` for a document with no ````, ````, or ```` root, so guard the result. The :doc:`feedparser migration guide ` maps the field names.