Rss Go Reference Documentation

Rss

Current Version: 10.0.0

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.

Object Creation

rss := chilkat.NewRss()
...
rss.DisposeRss()

Properties

DebugLogFilePath
func (rss *Rss) DebugLogFilePath() string
func (rss *Rss) SetDebugLogFilePath(s string)

If set to a file path, causes each Chilkat method or property call to automatically append it's LastErrorText to the specified log file. The information is appended such that if a hang or crash occurs, it is possible to see the context in which the problem occurred, as well as a history of all Chilkat calls up to the point of the problem. The VerboseLogging property can be set to provide more detailed information.

This property is typically used for debugging the rare cases where a Chilkat method call hangs or generates an exception that halts program execution (i.e. crashes). A hang or crash should generally never happen. The typical causes of a hang are:

  1. a timeout related property was set to 0 to explicitly indicate that an infinite timeout is desired,
  2. the hang is actually a hang within an event callback (i.e. it is a hang within the application code), or
  3. there is an internal problem (bug) in the Chilkat code that causes the hang.

More Information and Examples
top
LastErrorHtml
func (rss *Rss) LastErrorHtml() string

Provides information in HTML format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

top
LastErrorText
func (rss *Rss) LastErrorText() string

Provides information in plain-text format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

top
LastErrorXml
func (rss *Rss) LastErrorXml() string

Provides information in XML format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

top
LastMethodSuccess
func (rss *Rss) LastMethodSuccess() bool
func (rss *Rss) SetLastMethodSuccess(b bool)

Indicate whether the last method call succeeded or failed. A value of true indicates success, a value of false indicates failure. This property is automatically set for method calls. It is not modified by property accesses. The property is automatically set to indicate success for the following types of method calls:

  • Any method that returns a string.
  • Any method returning a Chilkat object, binary bytes, or a date/time.
  • Any method returning a standard boolean status value where success = true and failure = false.
  • Any method returning an integer where failure is defined by a return value less than zero.

Note: Methods that do not fit the above requirements will always set this property equal to true. For example, a method that returns no value (such as a "void" in C++) will technically always succeed.

top
NumChannels
func (rss *Rss) NumChannels() int

The number of channels in the RSS document.

top
NumItems
func (rss *Rss) NumItems() int

The number of items in the channel.

top
VerboseLogging
func (rss *Rss) VerboseLogging() bool
func (rss *Rss) SetVerboseLogging(b bool)

If set to true, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. The default value is false. Verbose logging should only be used for debugging. The potentially large quantity of logged information may adversely affect peformance.

top
Version
func (rss *Rss) Version() string

Version of the component/library, such as "9.5.0.94"

More Information and Examples
top

Methods

AddNewChannel
func (rss *Rss) AddNewChannel() *Rss

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

Returns nil on failure

top
AddNewImage
func (rss *Rss) AddNewImage() *Rss

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

Returns nil on failure

top
AddNewItem
func (rss *Rss) AddNewItem() *Rss

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

Returns nil on failure

top
DownloadRss
func (rss *Rss) DownloadRss(url string) bool

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

Returns true for success, false for failure.

More Information and Examples
top
DownloadRssAsync (1)
func (rss *Rss) DownloadRssAsync(url string, task chan *Task)

Creates an asynchronous task to call the DownloadRss method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Returns nil on failure

top
GetAttr
func (rss *Rss) GetAttr(tag string, attrName string) *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 nil on failure

top
GetChannel
func (rss *Rss) GetChannel(index int) *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.

Returns nil on failure

top
GetCount
func (rss *Rss) GetCount(tag string) int

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

top
GetDateStr
func (rss *Rss) GetDateStr(tag string) *string

The same as GetDate, except the date/time is returned in RFC822 string format.

Returns nil on failure

top
GetImage
func (rss *Rss) GetImage() *Rss

Return the image associated with the channel.

Returns nil on failure

top
GetInt
func (rss *Rss) GetInt(tag string) int

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

top
GetItem
func (rss *Rss) GetItem(index int) *Rss

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

Returns nil on failure

top
GetString
func (rss *Rss) GetString(tag string) *string

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

Returns nil on failure

top
LoadRssFile
func (rss *Rss) LoadRssFile(filePath string) bool

Load an RSS document from a file.

Returns true for success, false for failure.

top
LoadRssString
func (rss *Rss) LoadRssString(rssString string) bool

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

Returns true for success, false for failure.

top
LoadTaskCaller
func (rss *Rss) LoadTaskCaller(task *Task) bool
Introduced in version 9.5.0.80

Loads the caller of the task's async method.

Returns true for success, false for failure.

top
MGetAttr
func (rss *Rss) MGetAttr(tag string, index int, attrName string) *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 nil on failure

top
MGetString
func (rss *Rss) MGetString(tag string, index int) *string

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

Returns nil on failure

top
MSetAttr
func (rss *Rss) MSetAttr(tag string, idx int, attrName string, value string) bool

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

Returns true for success, false for failure.

top
MSetString
func (rss *Rss) MSetString(tag string, idx int, value string) bool

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

Returns true for success, false for failure.

top
NewRss
func (rss *Rss) NewRss()

Clears the RSS document.

top
Remove
func (rss *Rss) Remove(tag string)

Removes a sub-element from the RSS document.

top
SetAttr
func (rss *Rss) SetAttr(tag string, attrName string, value string)

Sets the value of a sub-element attribute.

top
SetDateNow
func (rss *Rss) SetDateNow(tag string)

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

top
SetDateStr
func (rss *Rss) SetDateStr(tag string, dateTimeStr string)

The same as SetDate, except the date/time is passed as an RFC822 string.

top
SetInt
func (rss *Rss) SetInt(tag string, value int)

Sets the value of an integer sub-element.

top
SetString
func (rss *Rss) SetString(tag string, value string)

Sets the value of a sub-element.

top
ToXmlString
func (rss *Rss) ToXmlString() *string

Returns the RSS document as an XML string.

Returns nil on failure

top