Chilkat VB.NET Rss Class Reference

Rss

Represents an RSS document or sub-part of a document such as a channel, image, or item. The RSS API allows one to download, create and modify RSS documents.

Properties

EnableEvents As Boolean

To be documented soon...

LastErrorHtml As String (ReadOnly)

Error information in HTML format for the last method called.

LastErrorText As String (ReadOnly)

Error information in plain-text format for the last method called.

LastErrorXml As String (ReadOnly)

Error information in XML format for the last method called.

NumChannels As Integer (ReadOnly)

The number of channels in the RSS document.

NumItems As Integer (ReadOnly)

The number of items in the channel.

Methods

Function AddNewChannel() As Rss

Adds a new channel to the RSS document. Returns the Rss object representing the Channel which can then be edited.

Function AddNewImage() As Rss

Adds a new image to the RSS document. Returns the Rss object representing the image, which can then be edited.

Function AddNewItem() As Rss

Adds a new Item to an Rss channel. Returns the Rss object representing the item which can then be edited.

Function DownloadRss(ByVal url As String) As Boolean

Downloads an RSS document from the Internet and populates the Rss object with the contents.

Example: Read RSS Feed

Function GetAttr(ByVal tag As String, ByVal attrName As String) As String

Returns the value of a sub-element attribute. For example, to get the value of the "isPermaLink" attribute of the "guid" sub-element, call item.GetAttr("guid","isPermaLink").

Returns Nothing on failure

Function GetChannel(ByVal index As Integer) As Rss

Returns the Nth channel of an RSS document. Usually there is only 1 channel per document, so the index argument should be set to 0.

Function GetCount(ByVal tag As String) As Integer

Return the number of sub-elements with a specific tag.

Function GetDate(ByVal tag As String) As Date

Return the value of a sub-element in date/time format.

Function GetImage() As Rss

Return the image associated with the channel.

Function GetInt(ByVal tag As String) As Integer

Return the value of a numeric sub-element as an integer.

Function GetItem(ByVal index As Integer) As Rss

Return the Nth item of a channel as an RSS object.

Function GetString(ByVal tag As String) As String

Return the value of an sub-element as a string.

Returns Nothing on failure

Function LoadRssFile(ByVal filename As String) As Boolean

Load an RSS document from a file.

Function LoadRssString(ByVal rssString As String) As Boolean

Loads an RSS feed document from an in-memory string.

Function MGetAttr(ByVal tag As String, ByVal idx As Integer, ByVal attrName As String) As String

Get an attribute value for the Nth sub-element having a specific tag. As an example, an RSS item may have several "category" sub-elements. To get the value of the "domain" attribute for the 3rd category, call MGetAttr("category",2,"domain").

Returns Nothing on failure

Function MGetString(ByVal tag As String, ByVal idx As Integer) As String

Get the value of the Nth occurance of a sub-element. Indexing begins at 0.

Returns Nothing on failure

Function MSetAttr(ByVal tag As String, ByVal idx As Integer, ByVal attrName As String, ByVal value As String) As Boolean

Set an attribute on the Nth occurance of a sub-element.

Function MSetString(ByVal tag As String, ByVal idx As Integer, ByVal value As String) As Boolean

Set the value of the Nth occurance of a sub-element. Indexing begins at 0.

Sub NewRss()

Clears the RSS document.

Sub Remove(ByVal tag As String)

Removes a sub-element from the RSS document.

Function SaveLastError(ByVal filename As String) As Boolean

Saves the last error information to an XML formatted file.

Sub SetAttr(ByVal tag As String, ByVal attrName As String, ByVal value As String)

Sets the value of a sub-element attribute.

Sub SetDate(ByVal tag As String, ByVal d As Date)

Sets the value of a date/time sub-element.

Sub SetDateNow(ByVal tag As String)

Sets the value of a date/time sub-element to the current system date/time.

Sub SetInt(ByVal tag As String, ByVal value As Integer)

Sets the value of an integer sub-element.

Sub SetString(ByVal tag As String, ByVal value As String)

Sets the value of a sub-element.

Function ToXmlString() As String

Returns the RSS document as an XML string.

Returns Nothing on failure