webls/rss
Types
Cloud configuration for an RSS channel
pub type Cloud {
Cloud(
domain: String,
port: Int,
path: String,
register_procedure: String,
protocol: String,
)
}
Constructors
-
Cloud( domain: String, port: Int, path: String, register_procedure: String, protocol: String, )
Arguments
-
domain
The domain of the cloud service
-
port
The port for the cloud service
-
path
The path for the cloud service
-
register_procedure
The registration procedure for the cloud service (usually “http-post” or “xml-rpc”)
-
protocol
The protocol used for the cloud service
-
An enclosure resource for an RSS item
pub type Enclosure {
Enclosure(url: String, length: Int, enclosure_type: String)
}
Constructors
-
Enclosure(url: String, length: Int, enclosure_type: String)
Arguments
-
url
The URL of the enclosure resource
-
length
The length of the enclosure in bytes
-
enclosure_type
The type of the enclosure (e.g., audio/mpeg, video/mp4)
-
An image associated with a RSS channel
pub type Image {
Image(
url: String,
title: String,
link: String,
description: Option(String),
width: Option(Int),
height: Option(Int),
)
}
Constructors
-
Image( url: String, title: String, link: String, description: Option(String), width: Option(Int), height: Option(Int), )
Arguments
-
url
The URL of the image
-
title
The title of the image
-
link
The link associated with the image
-
description
An optional description of the image
-
width
An optional width of the image in pixels
-
height
An optional height of the image in pixels
-
RSS 2.0.1 spec compliant channel
pub type RssChannel {
RssChannel(
title: String,
link: String,
description: String,
language: Option(String),
copyright: Option(String),
managing_editor: Option(String),
web_master: Option(String),
pub_date: Option(Time),
last_build_date: Option(Time),
categories: List(String),
generator: Option(String),
docs: Option(String),
cloud: Option(Cloud),
ttl: Option(Int),
image: Option(Image),
text_input: Option(TextInput),
skip_hours: List(Int),
skip_days: List(birl.Weekday),
items: List(RssItem),
)
}
Constructors
-
RssChannel( title: String, link: String, description: String, language: Option(String), copyright: Option(String), managing_editor: Option(String), web_master: Option(String), pub_date: Option(Time), last_build_date: Option(Time), categories: List(String), generator: Option(String), docs: Option(String), cloud: Option(Cloud), ttl: Option(Int), image: Option(Image), text_input: Option(TextInput), skip_hours: List(Int), skip_days: List(birl.Weekday), items: List(RssItem), )
Arguments
-
title
The title of the RSS channel
-
link
The link to the top page of the RSS channel
-
description
The description of the RSS channel
-
language
The language of the RSS channel
-
copyright
The copyright information for the RSS channel
-
managing_editor
The managing editor’s email address
-
web_master
The web master’s email address
-
pub_date
The publication date of the RSS channel
-
last_build_date
The last build date of the RSS channel
-
categories
A list of categories for the RSS channel
-
generator
The generator program of the RSS channel, feel free to shout webls out!
-
docs
A link to the documentation for the RSS spec
-
cloud
Cloud configuration for the RSS channel
-
ttl
The time-to-live (TTL) for the RSS channel
-
image
An optional image associated with the RSS channel
-
text_input
An optional text input for the RSS channel
-
skip_hours
A list of hours in GMT which content aggregation should be skipped
-
skip_days
A list of days to skip in the RSS channel
-
items
A list of items in the RSS channel
-
RSS 2.0.1 spec compliant item
pub type RssItem {
RssItem(
title: String,
description: String,
link: Option(String),
author: Option(String),
comments: Option(String),
source: Option(String),
pub_date: Option(Time),
categories: List(String),
enclosure: Option(Enclosure),
guid: Option(#(String, Option(Bool))),
)
}
Constructors
-
RssItem( title: String, description: String, link: Option(String), author: Option(String), comments: Option(String), source: Option(String), pub_date: Option(Time), categories: List(String), enclosure: Option(Enclosure), guid: Option(#(String, Option(Bool))), )
Arguments
-
title
The title of the RSS item
-
description
The description of the RSS item
-
link
The link to the page or source of the RSS item
-
author
An optional author field, note RSS author must be email addresses
-
comments
A URL to the comments section for the RSS item
-
source
The RSS channel the item came from
-
pub_date
The publication date of the RSS item
-
categories
A list of categories for the RSS item
-
enclosure
An optional enclosure resource for the RSS item
-
guid
A guid and an optional boolean for whether it is a permalink
-
A text input field for an RSS channel
pub type TextInput {
TextInput(
title: String,
description: String,
name: String,
link: String,
)
}
Constructors
-
TextInput( title: String, description: String, name: String, link: String, )
Arguments
-
title
The title of the text input field
-
description
A description of the text input field’s purpose
-
name
The name attribute for the text input field
-
link
The link associated with the text input field
-
Functions
pub fn channel(
title: String,
description: String,
link: String,
) -> RssChannel
Creates a base RSS channel
pub fn to_string(channels: List(RssChannel)) -> String
Converts a list of RSS channels to a string of a valid RSS 2.0.1 feed
pub fn with_channel_categories(
channel: RssChannel,
categories: List(String),
) -> RssChannel
Adds a list of categories to the RSS channel
pub fn with_channel_category(
channel: RssChannel,
category: String,
) -> RssChannel
Adds a category to the RSS channel
pub fn with_channel_cloud(
channel: RssChannel,
cloud: Cloud,
) -> RssChannel
Sets the cloud element for the RSS channel with a domain, port, path, register procedure, and protocol
pub fn with_channel_copyright(
channel: RssChannel,
copyright: String,
) -> RssChannel
Sets the copyright information for the RSS channel
pub fn with_channel_custom_generator(
channel: RssChannel,
generator: String,
) -> RssChannel
Sets the generator element for the RSS channel with a custom string
pub fn with_channel_docs(channel: RssChannel) -> RssChannel
Adds the RSS 2.0.1 spec documentation link to the RSS channel
pub fn with_channel_generator(channel: RssChannel) -> RssChannel
Sets the generator element for the RSS channel to webls
pub fn with_channel_image(
channel: RssChannel,
image: Image,
) -> RssChannel
Sets an optional image associated with the RSS channel
pub fn with_channel_item(
channel: RssChannel,
item: RssItem,
) -> RssChannel
Adds a RSS item to the RSS channel
pub fn with_channel_items(
channel: RssChannel,
items: List(RssItem),
) -> RssChannel
Adds a list of items in the RSS channel
pub fn with_channel_language(
channel: RssChannel,
language: String,
) -> RssChannel
Sets the language of the RSS channel example: “en-us”
pub fn with_channel_last_build_date(
channel: RssChannel,
last_build_date: Time,
) -> RssChannel
Sets the last build date of the RSS channel
pub fn with_channel_managing_editor(
channel: RssChannel,
managing_editor: String,
) -> RssChannel
Sets the managing editor’s email address for the RSS channel
pub fn with_channel_pub_date(
channel: RssChannel,
pub_date: Time,
) -> RssChannel
Sets the publication date of the RSS channel
pub fn with_channel_skip_days(
channel: RssChannel,
skip_days: List(Weekday),
) -> RssChannel
Sets a list of days to skip in the RSS channel
pub fn with_channel_skip_hours(
channel: RssChannel,
skip_hours: List(Int),
) -> RssChannel
Sets a list of hours in GMT which content aggregation should be skipped
pub fn with_channel_text_input(
channel: RssChannel,
text_input: TextInput,
) -> RssChannel
Sets an optional text input for the RSS channel
pub fn with_channel_ttl(
channel: RssChannel,
ttl: Int,
) -> RssChannel
Sets the time-to-live (TTL) for the RSS channel in minutes
pub fn with_channel_web_master(
channel: RssChannel,
web_master: String,
) -> RssChannel
Sets the web master’s email address for the RSS channel
pub fn with_item_author(item: RssItem, author: String) -> RssItem
Sets an optional author field, note RSS author must be email addresses
pub fn with_item_categories(
item: RssItem,
categories: List(String),
) -> RssItem
Sets a list of categories for the RSS item
pub fn with_item_comments(
item: RssItem,
comments: String,
) -> RssItem
Sets a URL to the comments section for the RSS item
pub fn with_item_enclosure(
item: RssItem,
enclosure: Enclosure,
) -> RssItem
Sets an optional enclosure (media resource) for the RSS item
pub fn with_item_guid(
item: RssItem,
guid: #(String, Option(Bool)),
) -> RssItem
Sets the guid of the RSS item with an optional boolean for whether it is a permalink
pub fn with_item_link(item: RssItem, link: String) -> RssItem
Sets the link to the page or source of the RSS item
pub fn with_item_pub_date(
item: RssItem,
pub_date: Time,
) -> RssItem
Sets the publication date of the RSS item
pub fn with_item_source(item: RssItem, source: String) -> RssItem
Sets the RSS channel the item came from