Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The RSS Library

The Kynetx Rule Language has native support for handling and processing RSS feeds.  The KRL convenience functions can be grouped into feed, channel and item functions.

Feed Functions

version

The rss:version() function takes in a dataset or datasource and returns the version.

The following is an example of rss:version

Code Block
themeConfluence
languagejavascript
pre {
  rssVersion = rss:version(rss_data_set);
}

Channel Functions

items

the rss:items() function takes in a dataset or datasource and returns an array of all the RSS items in the feed.

The following is an example of rss:items()

Code Block
themeConfluence
languagejavascript
pre {
  rssItems = rss:items(rss_data_set);
}

first

the rss:first() function takes in a dataset or datasource and returns the first item from the channel feed.

The following is an example of rss:items()

Code Block
themeConfluence
languagejavascript
pre {
  rssFirstItem = rss:first(rss_data_set);
}

last

the rss:last() function takes in a dataset or datasource and returns the last item from the channel feed.

The following is an example of rss:last()

Code Block
themeConfluence
languagejavascript
pre {
  rssLastItem = rss:last(rss_data_set);
}

index

The rss:index() function returns the nth item from the feed.

List of arguments

  • dataset or datasource
  • an integer n.

The following is an example of rss:index()

Code Block
themeConfluence
languagejavascript
pre {
  rssThirdItem = rss:index(rss_data_set, 3);
}

random

The rss:random() function returns a random item from the feed

The following is an example of rss:random()

Code Block
themeConfluence
languagejavascript
pre {
  rssRandomItem = rss:random(rss_data_set);
}

channel

The rss:channel() function returns values from the various channel elements.

List of arguments

  • dataset or datasource
  • string with the name of the desired element, ie: "title"

The following is an example of rss:index()

Code Block
themeConfluence
languagejavascript
pre {
  rssChannelTitle = rss:channel(rss_data_set, "title");
}

Item Functions

item

The rss:item

 

 

 

 

 

Anchor
_GoBack
_GoBack