PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • How to proceed?
  • Creating an RSS stream
  • Examples
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
WINDEV, WEBDEV and WINDEV Mobile allow you to produce and/or consume an RSS stream (Rapid Simple Syndication).
An RSS stream 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 stream is used to display one or more RSS streams.
Versions 17 and later
iPhone/iPad This feature is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This feature is now available for the iPhone/iPad applications.
iPhone/iPad This feature is now available for the iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This feature is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This feature is now available in Windows Store apps mode.
Universal Windows 10 App This feature is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
How to proceed?

Creating an RSS stream

To create an RSS stream:
  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.
Notes:
  • 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 stream:
MyStream is rssStream
MyChannel is rssChannel
MyEntry is rssEntry
MyPath is string

// Characteristics of channel
MyChannel..Title = "My site"
MyChannel..Description = "Example of RSS 2.0 stream"
MyChannel..UpdateDate = DateSys() + TimeSys()
MyChannel..Link = "http://www.example.org"
// Characteristics of entries of channel 1
MyEntry..Author = "pcsoft@pcsoft.fr"
MyEntry..Description = "First news"
MyEntry..Title = "News #1"
// Adds the entry into the channel
Add(MyChannel..Entry, MyEntry)
// Adds the channel into the stream
Add(MyStream..Channel, MyChannel)

// Saves the stream in a file
MyPath = CompleteDir(fCurrentDir()) + "Rss.xml"
rssSave(MyStream, MyPath)

// Displays the XML file of stream
IF not ShellExecute(MyPath) THEN
Error("ShellExecute('" + MyPath + "'). '" + ErrorInfo() + "'")
END
Caution: In this example, the additions performed by Add must be performed last to handle the requested 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 dynamic rssEntry = 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 required version
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment