ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / RSS Stream functions
  • Overview
  • How to?
  • Create an RSS feed
  • Examples
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Create an RSS feed
Overview
WINDEV, WEBDEV and WINDEV Mobile allow you to produce and/or consume an RSS feed (Rapid Simple Syndication).
An RSS feed is used to produce (make available) a data stream in standard format. This data stream can be read (consumed) by an application.
A reader of RSS feed is used to display one or more RSS feeds.
How to?

Create an RSS feed

To create an RSS feed:
  1. Declare the rssStream, rssChannel and rssEntry variables.
  2. Describe the channel with the rssChannel properties.
  3. Describe the entries with the rssEntry properties.
  4. Add the channel then its entries into the stream.
Remarks:
  • A stream is made of channels. A channel is made of entries.
  • We recommend that you use functions such as Add, Delete, … to handle the array of entries and the array of channels.

Examples

Example for creating a RSS feed:
MonFlux is rssStream
MonCanal is rssChannel
MonEntrée is rssEntry
MonChemin is string

// Renseignements du canal
MonCanal.Title = "Mon site"
MonCanal.Description = "Exemple de flux RSS 2.0"
MonCanal.UpdateDate = DateSys() + TimeSys()
MonCanal.Link = "http://www.example.org"
// Renseignements des entrées du canal 1
MonEntrée.Author = "pcsoft@pcsoft.fr"
MonEntrée.Description = "Première actualité"
MonEntrée.Title = "Actualité N°1"
// Ajoute l'entrée dans le canal
Add(MonCanal.Entry, MonEntrée)
// Ajoute le canal dans le flux
Add(MonFlux.Channel, MonCanal)

// Sauve le flux dans un fichier
MonChemin = CompleteDir(fCurrentDir()) + "Rss.xml"
rssSave(MonFlux, MonChemin)

// Affiche le fichier XML du flux
IF NOT ShellExecute(MonChemin) THEN
	Error("LanceAppliAssociée('" + MonChemin + "'). '" + ErrorInfo() + "'")
END
Please note In this example, additions made with the Add function must be made last to manipulate the desired element. You also have the ability to use the following code:
MyStream is rssStream 
ChannelNum is int
EntryNum is int
MyPath is string

MyPath = CompleteDir(fCurrentDir()) + "Rss.xml"

// Describe and add the channel
ChannelNum = 1
ChannelNum = Add(MyStream.Channel)
MyStream.Channel[ChannelNum].Title = "My site"
MyStream.Channel[ChannelNum].Description = "Example of RSS 2.0 stream"
MyStream.Channel[ChannelNum].PublicationDate = Today()
MyStream.Channel[ChannelNum].Link = "http://www.example.org"

// Describe and add the entry 1
EntryNum = Add(MyStream.Channel[ChannelNum].Entry)
MyStream.Channel[ChannelNum].Entry[EntryNum].Title = "First news"
MyStream.Channel[ChannelNum].Entry[EntryNum].Description = "News #1"
MyStream.Channel[ChannelNum].Entry[EntryNum].Link = "http://www.example.org"
MyStream.Channel[ChannelNum].Entry[EntryNum].PublicationDate = Today()
EntryNum = Add(MyStream.Channel[ChannelNum].Entry)

// Describe and add the next entry
MyEntry is rssEntry dynamic = MyStream.Channel[ChannelNum].Entry[EntryNum]
MyEntry.Title = "Second news"
MyEntry.Description = "News #2"
MyEntry.Link = "http://www.example.org"
MyEntry.PublicationDate = Today()

// Saves the stream in a file
rssSave(MyStream, MyPath)

// Displays the XML file of stream
IF NOT ShellExecute(MyPath) THEN
	Error("ShellExecute('" + MyPath + "'). '" + ErrorInfo() + "'")
END
Related Examples:
The RSS functions Unit examples (WINDEV): The RSS functions
[ + ] Using the WLanguage RSS functions.
These functions are used to read and create a stream.
These functions can be handled by specific types of variables: rssStream, rssChannel,...
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help