Skip to main content

Create feed (RSS)

Creates RSS feed text

Function CreateFeedRSS(Val ChannelTitle, Val ChannelDescription, Val ChannelLink, Val Items, Val UpdateDate = Undefined) Export

ParameterCLI optionTypeRequiredDescription
ChannelTitle--nameStringChannel title
ChannelDescription--descrStringChannel description
ChannelLink--linkStringChannel link
Items--itemsArray of StructureFeed items. See GetFeedItemStructureRSS
UpdateDate--dateDate, UndefinedUpdate date. Current if not filled
Returns

String - Channel XML feed

1C:Enterprise/OneScript code example
ChannelTitle = "Test RSS channel";
ChannelDescription = "Test RSS channel description";
ChannelLink = "https://example.com";

ItemsArray = New Array;

ElementStructure = OPI_RSS.GetFeedItemStructureRSS(True);
ElementStructure["title"] = "First element";
ElementStructure["description"] = "First element description";
ElementStructure["link"] = "https://example.com/item1";
ElementStructure["pubDate"] = OPI_Tools.GetCurrentDate();
ElementStructure["author"] = "test@example.com";
ElementStructure["guid"] = "item-1";

ItemsArray.Add(ElementStructure);

ElementStructure = OPI_RSS.GetFeedItemStructureRSS(True);
ElementStructure["title"] = "Second element";
ElementStructure["description"] = "Second element description";
ElementStructure["link"] = "https://example.com/item2";
ElementStructure["pubDate"] = OPI_Tools.GetCurrentDate();
ElementStructure["author"] = "test@example.com";
ElementStructure["guid"] = "item-2";

ItemsArray.Add(ElementStructure);

Result = OPI_RSS.CreateFeedRSS(ChannelTitle, ChannelDescription, ChannelLink, ItemsArray);
# JSON data can also be passed as a path to a .json file

oint rss CreateFeedRSS \
--name "Test RSS channel" \
--descr "Test RSS channel description" \
--link "https://example.com" \
--items "[{'title':'First element','description':'First element description','link':'https://example.com/item1','pubDate':'05/26/2026 14:40:16','author':'test@example.com','guid':'item-1'},{'title':'Second element','description':'Second element description','link':'https://example.com/item2','pubDate':'05/26/2026 14:40:17','author':'test@example.com','guid':'item-2'}]"
Result
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rss version=\"2.0\">\n <channel>\n <title>Test RSS channel</title>\n <link>https://example.com</link>\n <description>Test RSS channel description</description>\n <lastBuildDate>Tue, 0,000,000,026 May 2026 14:40:17 +0000</lastBuildDate>\n <item>\n <title>First element</title>\n <description>First element description</description>\n <link>https://example.com/item1</link>\n <pubDate>Tue, 0,000,000,026 May 2026 14:40:16 +0000</pubDate>\n <author>test@example.com</author>\n <guid isPermaLink=\"false\">item-1</guid>\n </item>\n <item>\n <title>Second element</title>\n <description>Second element description</description>\n <link>https://example.com/item2</link>\n <pubDate>Tue, 0,000,000,026 May 2026 14:40:17 +0000</pubDate>\n <author>test@example.com</author>\n <guid isPermaLink=\"false\">item-2</guid>\n </item>\n </channel>\n</rss>"