class RSS::Channel

Overview

Contains information about an RSS channel (metadata) and its contents.

For precise documentation, see https://validator.w3.org/feed/docs/rss2.html

Defined in:

cryss/channel.cr

Constructors

Instance Method Summary

Instance methods inherited from class RSS::Element

ns(name : String, &) ns, to_s(io : IO) to_s, to_xml(io : IO)
to_xml(xml : XML::Builder)
to_xml

Constructor Detail

def self.new(link : URI | String, title : String, description : String) #

[View source]

Instance Method Detail

def <<(item : Item) #

[View source]
def add_ns(name : String | Symbol, url : URI | String) #

[View source]
def add_ns(**ns) #

[View source]
def category : Array(Category) #

Specify one or more categories that the channel belongs to. Follows the same rules as the Item-level category element. More info.


[View source]
def category=(category : Array(RSS::Category)) #

[View source]
def cloud : Cloud | Nil #

Allows processes to register with a Cloud to be notified of updates to the channel, implementing a lightweight publish-subscribe protocol for RSS feeds. More info here.


[View source]
def cloud=(cloud : Nil | RSS::Cloud) #

[View source]
def copyright : String | Nil #

Copyright notice for content in the channel.

Example: Copyright 2002, Spartanburg Herald-Journal


[View source]
def copyright=(copyright : Nil | String) #

[View source]
def description : String #

Phrase or sentence describing the channel.


[View source]
def description=(description : String) #

[View source]
def docs : URI #

A URL that points to the documentation for the format used in the RSS file.

Defaults to the W3 RSS 2.0 specification. It's for people who might stumble across an RSS file on a Web server 25 years from now and wonder what it is.


[View source]
def docs=(docs : URI) #

[View source]
def generator : String #

A string indicating the program used to generate the channel.


[View source]
def generator=(generator : String) #

[View source]
def image : Image | Nil #

Specifies a GIF, JPEG or PNG image that can be displayed with the channel.


[View source]
def image=(image : Nil | RSS::Image) #

[View source]
def items : Array(Item) #

Contained elements of the channel.


[View source]
def language : String | Nil #

The language the channel is written in.

This allows aggregators to group all Italian language sites, for example, on a single page. A list of allowable values for this element, as provided by Netscape, is here. You may also use values defined by the W3C.

Example: en-us


[View source]
def language=(language : Nil | String) #

[View source]
def last_build_date : Time | Nil #

The last time the content of the channel changed.

Example: Sat, 07 Sep 2002 9:42:31 GMT


[View source]
def last_build_date=(last_build_date : Time | Nil) #

[View source]
def link : URI #

The URL to the HTML website corresponding to the channel.


[View source]
def link=(link : URI) #

[View source]
def managing_editor : String | Nil #

Email address for person responsible for editorial content.

Example: [email protected] (George Matesky)


[View source]
def managing_editor=(managing_editor : Nil | String) #

[View source]
def pub_date : Time | Nil #

The publication date for the content in the channel.

For example, the New York Times publishes on a daily basis, the publication date flips once every 24 hours. That's when the pubDate of the channel changes. All date-times in RSS conform to the Date and Time Specification of RFC 822, with the exception that the year may be expressed with two characters or four characters (four preferred).

Example: Sat, 07 Sep 2002 0:00:01 GMT


[View source]
def pub_date=(pub_date : Time | Nil) #

[View source]
def push(item : Item) #

[View source]
def skip_days : Array(Day) #

A hint for aggregators telling them which hours they can skip.


[View source]
def skip_days=(skip_days : Array(RSS::Day)) #

[View source]
def skip_hours : Array(Int32) #

A hint for aggregators telling them which days they can skip.


[View source]
def skip_hours=(skip_hours : Array(Int32)) #

[View source]
def text_input : TextInput | Nil #

Specifies a TextInput box that can be displayed with the channel.


[View source]
def text_input=(text_input : Nil | RSS::TextInput) #

[View source]
def title : String #

The name of the channel.

It's how people refer to your service. If you have an HTML website that contains the same information as your RSS file, the title of your channel should be the same as the title of your website.


[View source]
def title=(title : String) #

[View source]
def to_xml(xml : XML::Builder) #

Serialises the channel to the XML builder.


[View source]
def ttl : Int32 | Nil #

Time to live.

It's a number of minutes that indicates how long a channel can be cached before refreshing from the source. More info here.


[View source]
def ttl=(ttl : Int32 | Nil) #

[View source]
def webmaster : String | Nil #

Email address for person responsible for technical issues relating to channel.

Example: [email protected] (Betty Guernsey)


[View source]
def webmaster=(webmaster : Nil | String) #

[View source]