from feed

This block is part of the array group and was last modified in core v15.0.2.

from feed v15.0.2

Reads an RSS, Atom or JSON feed into a list of items that all have the same fields: id, title, link, published, updated, summary, content, image, author and categories. Connect the body of the HTTP request that fetched the feed.

In pins 2
  • feed body value required

    The feed document: the body of the HTTP request that fetched it.

  • base url value

    The address the feed was fetched from. Relative links and images are made absolute against it when the feed itself does not say what they are relative to.

Out pins 4
  • items array<object>

    One object per item, in the order the feed lists them. published and updated are unix seconds, 0 when the item has no date.

  • feed object

    The feed itself: title, link, description and image.

  • success condition

    False when the body is not a feed. The items are then empty.

  • error value

    Why the body could not be read as a feed (only if success is false).

Parses a feed document (RSS 2.0/0.9x, RSS 1.0 RDF, Atom 1.0/0.3, or JSON Feed 1.0/1.1; detected from the root element, or a leading '{' for JSON) and outputs array: one object per item in document order, each {id, title, link, published, updated, summary, content, image, author, categories}. id is guid/id/rdf:about, else the link. title and summary are ONE line of plain text (tags stripped, all entities decoded, whitespace collapsed); summary comes from description/summary, else from the content. content is HTML (content:encoded, Atom content, content_html; else the description/summary HTML). published and updated are unix SECONDS (numbers); a date without a zone is read in the entity timezone; each falls back to the other, and both are 0 when the item has no readable date. image is the first of: an image enclosure, media:content of an image, media:thumbnail, itunes:image, the first <img> in the item's HTML; "" when none. author is a name (an RSS "mail (Name)" author gives Name; an Atom entry inherits the feed's author). categories is an array of strings (RSS category and dc:subject, Atom category term, JSON Feed tags). link and image are made absolute against xml:base, then the feed's own site link, then base_url. feed is {title, link, description, image} of the feed itself. Non-UTF-8 bodies declared ISO-8859-1/windows-1252 are decoded; HTML entities XML does not define (&nbsp;) and a stray & are tolerated. Anything that is not a feed (empty body, an HTML page, XML with another root, JSON without items or a jsonfeed.org version, a truncated document) gives success false, error saying why, an EMPTY array and an empty feed object. A valid feed with no items gives success true and an empty array. Pure: no network access; fetch the feed with an HTTP block first.

rss
atom
parse rss
parse feed
rss feed
json feed
podcast feed

Version history

Introduced in v15.0.2.


Back to array Return to the main group to view all sub-groups Back to array Return to the group to view all blocks within this group