Feed

Reads RSS/Atom feeds from URLs or files, and creates new RSS/Atom feeds from data. Compatible with CFML's cffeed tag.

Syntax

Read Action

<bx:feed
    action="read"
    source="string"
    result="string"
    properties="string"
    query="string"
    xmlVar="string"
    outputFile="string"
    overwrite="boolean"
    timeout="numeric"
    userAgent="string"
    maxItems="numeric"
    itunes="boolean"
    mediaRss="boolean" />

Create Action

Attributes

Attribute
Type
Required
Description
Default

action

string

No

Action to perform: "read" or "create"

"read"

source

string

Yes (read)

URL or file path to the feed to read

result

string

No

Variable name to store the full feed structure

name

struct/string

No

For read: alias for result. For create: input struct containing full feed data

properties

struct/string

Yes (create)

For create: feed metadata. For read: output variable for channel metadata

data

array/query

Yes (create)

Feed items/entries for creation

query

any

No

For create: alias for data. For read: output variable for items

columnMap

struct

No

Map query columns to feed fields (for query data)

{}

outputFile

string

No

File path to write the feed XML

overwrite

boolean

No

Whether to overwrite existing output file

false

xmlVar

string

No

Variable name to store the raw XML string

timeout

numeric

No

HTTP timeout in seconds for read action

60

userAgent

string

No

Custom User-Agent for HTTP requests

""

maxItems

numeric

No

Maximum number of items to return (read action)

0 (unlimited)

itunes

boolean

No

Parse iTunes podcast extensions (read action)

false

mediaRss

boolean

No

Parse Media RSS extensions (read action)

false

feedType

string

No

Feed format for creation: "rss_2.0" or "atom"

"rss_2.0"

escapeChars

boolean

No

Escape special characters in create action

false

Examples

Basic Feed Reading

Reading with Multiple Output Variables

Reading Podcast Feed with iTunes Extensions

Reading with Media RSS Extensions

Saving Feed to File

Creating a Basic RSS Feed

Creating Feed from Query Data

Creating Atom Feed

Using Name Attribute for Simplified Creation

Reading Local Feed File

Creating Feed with Result Information

Output Variables

Read Action Output

When using the read action, the component can populate multiple output variables:

result Variable Structure

properties Variable (Channel Metadata Only)

Contains only the channel/feed metadata without the items array.

query Variable (Items Only)

Contains only the items array without the channel metadata.

xmlVar Variable

Contains the raw XML content as retrieved from the source.

Create Action Output

xmlVar Variable

Contains the generated RSS/Atom XML as a string.

result Variable Structure (Create)

Usage Notes

Read Action

  • Supports RSS 2.0, RSS 1.0 (RDF), and Atom feeds

  • Can read from HTTP/HTTPS URLs or local file paths

  • Multiple output variables can be used simultaneously

  • iTunes and Media RSS extensions provide additional metadata

  • Use maxItems to limit memory usage for large feeds

Create Action

  • Generates RSS 2.0 or Atom feeds

  • Accepts data as arrays of structs or query objects

  • Use columnMap to map query columns to RSS fields

  • Set escapeChars=true to escape special characters in content

  • Can output to variable, file, or both

File Operations

  • Set overwrite=true to replace existing files

  • Component will create parent directories if they don't exist

  • File paths can be absolute or relative to the application root

Last updated

Was this helpful?