Skip to main content

How to Retrieve RSS Feeds with Kuroco?

It is possible to retrieve RSS feeds periodically using batch processing and add or update them in Kuroco's content.

Retrieving RSS Feeds

By writing the following Smarty code in batch processing, you can retrieve the contents of an RSS feed as an associative array.

{get_file var='rss_xml' url='' save=false}{* Retrieve the contents of the RSS feed *}
{xmltojson var='rss_json' xml=$rss_xml}{* Convert XML to JSON *}
{assign var='rss_feed' value=$rss_json|@json_decode}{* Convert JSON to an associative array *}

You can confirm the retrieved and converted RSS content by adding the following code for testing:

Updating Kuroco Content

If you want to update multiple contents at once, you can use the bulk_upsert API to reduce the number of requests and processing time. By converting the retrieved RSS data as shown below and posting it to the API, you can update the content.

{* Convert RSS data to the format of Kuroco content *}
{assign_array var='body' values=''}
{assign_array var='body.list' values=''}
{foreach from=$rss_feed.entry item='entry'}
{assign_array var='topics' values=''}
{assign var='topics.subject' value=$entry.title}
{assign var='topics.ext_1' value=$}
{assign var='topics.ext_2' value=$entry.updated}

{assign var='body.list.' value=$topics}

{* Bulk update of content *}


If you have any other questions, please contact us or check out Our Slack Community.