Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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

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()

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()

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()

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()

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()

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()

pre {
  rssChannelTitle = rss:channel(rss_data_set, "title");
}

Item Functions

item

The rss:item

 

 

 

 

 

  • No labels