PodcastRSS (Podcast RSS v0.3.0)
View SourceA library for generating podcast RSS feeds.
PodcastRSS provides a simple, pipeline-friendly API for creating RSS 2.0 feeds suitable for podcast distribution. It focuses on simplicity and readability while supporting the core requirements for podcast feeds.
Examples
alias PodcastRSS.Episode
channel = PodcastRSS.new()
|> PodcastRSS.title("Retro Gaming Chronicles")
|> PodcastRSS.link("https://example.com")
|> PodcastRSS.description("Exploring the golden age of video games")
|> PodcastRSS.self_link("https://feeds.example.com/rss")
|> PodcastRSS.image("https://example.com/cover.png")
|> PodcastRSS.language("en-us")
episode = channel
|> PodcastRSS.new_episode()
|> Episode.title("The Birth of the NES")
|> Episode.description("How Nintendo revolutionized home gaming in 1985")
|> Episode.enclosure("https://example.com/episodes/nes-birth.mp3", 45678901, "audio/mpeg")
|> Episode.guid("retro-001-nes-birth")
|> Episode.duration("01:23:45")
feed_xml = channel
|> PodcastRSS.add_episode(episode)
|> PodcastRSS.to_xml()
Summary
Functions
Add an episode to the channel.
Set the podcast category.
Set the podcast category with subcategory.
Add a custom field to the channel.
Set the channel description.
Set the podcast type to episodic.
Set the podcast cover image URL.
Set the podcast language.
Set the channel link (website URL).
Create a new channel with useful defaults.
Create a new episode that inherits the channel's namespaces.
Register a namespace for use in custom fields.
Set the canonical RSS feed URL.
Set the podcast type to serial.
Set the channel title.
Convert the channel to RSS XML string.
Functions
Add an episode to the channel.
Delegates to PodcastRSS.Channel.add_episode/2.
Set the podcast category.
Delegates to PodcastRSS.Channel.category/2.
Set the podcast category with subcategory.
Delegates to PodcastRSS.Channel.category/3.
Add a custom field to the channel.
Delegates to PodcastRSS.Channel.custom_field/4.
Set the channel description.
Delegates to PodcastRSS.Channel.description/2.
@spec episodic(PodcastRSS.Channel.t()) :: PodcastRSS.Channel.t()
Set the podcast type to episodic.
Delegates to PodcastRSS.Channel.type/2.
Set the podcast cover image URL.
Delegates to PodcastRSS.Channel.image/2.
Set the podcast language.
Delegates to PodcastRSS.Channel.language/2.
Set the channel link (website URL).
Delegates to PodcastRSS.Channel.link/2.
@spec new() :: PodcastRSS.Channel.t()
Create a new channel with useful defaults.
Pre-registers common podcast namespaces:
- iTunes namespace for iTunes-specific tags
- Podcast Index namespace for modern podcast features
- Atom namespace for RSS 2.0 compliance
- PSC (Podlove Simple Chapters) namespace for chapter support
Sets default values:
- Language: "en-us"
- iTunes block: "No"
- iTunes complete: "No"
For a completely empty channel without any defaults, use PodcastRSS.Channel.new/0.
Create a new episode that inherits the channel's namespaces.
Delegates to PodcastRSS.Channel.new_episode/1.
Register a namespace for use in custom fields.
Delegates to PodcastRSS.Channel.register_namespace/3.
Set the canonical RSS feed URL.
Delegates to PodcastRSS.Channel.self_link/2.
@spec serial(PodcastRSS.Channel.t()) :: PodcastRSS.Channel.t()
Set the podcast type to serial.
Delegates to PodcastRSS.Channel.type/2.
Set the channel title.
Delegates to PodcastRSS.Channel.title/2.
Convert the channel to RSS XML string.
Delegates to PodcastRSS.XML.to_xml/1.