Skip to content

๐ŸŽ™ Easily generate RSS podcast feeds from a simple JSON object (100% test coverage, compatible with every major podcast player)

License

Notifications You must be signed in to change notification settings

AnalyzePlatypus/PodcastFeedGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

39 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

PodcastFeedGenerator

Build Status Coverage Status mit license

Easily generate industry-standard podcast RSS feeds.

require "podcast_feed_generator"

json = JSON.parse(File.open("feed.json").read) # A JSON file containing all of your podcast's info

rss_feed = PodcastFeedGenerator::Generator.new.generate json

Installation

$ gem install podcast_feed_generator

Or add this line to your application's Gemfile:

gem 'podcast_feed_generator'

Build

$ cd PodcastFeedGenerator/
$ gem build podcast_feed_generator.gemspec
$ gem install podcast_feed_generator

Usage

PodcastFeedGenerator has exactly one public method: generate, which expects a Ruby hash with the following shape:

{
  "podcast": {
    "title": "Podcast Title",
    "description": "Podcast Description",
    "link": "link/to/show",
    "author": "Podcast author",
    "ownerName": "Podcast owner",
    "ownerEmail": "[email protected]",
    "podcastArtworkUrl": "link/to/feedImage",
     "categories": [ // Add up to three of the official iTunes categories: https://castos.com/itunes-podcast-category-list/
      "Category 1",
      "Category 2",
      "Category 3"
    ],

    // Optional
    "lastBuildDate": "2019-06-23",           // Defaults to current date
    "generator": "PodcastFeedGenerator gem", // Defaults to "PodcastFeedGenerator"
    "subtitle": "Podcast subtitle",          // Defaults to value of `description`
    "summary": "Podcast summary",            // Defaults to value of `description`
    "explicit": "no",                        // Can be one of `yes` | `no` | `explicit`.  Defaults to "no"
    "language": "en-US",                     // Defaults to `en-US`
    "podcastType": "Episodic",               // `Episodic` or `Serial`. `Episodic` causes iTunes to list newest first; `Serial`, oldest first
    "copyright": "(c) Podcast Copyright Notice" // Empty by default
  },
  "episodes": [
    {
      "title": "Episode Title",
      "pubDate": "2019-05-01",
      "link": "link/to/episode", 
      "description": "Episode description",
      "mediaFileUrl": "https://my-site.io/podcast/1",
      "duration": "00:33:12",
      "mediaFileSizeBytes": "34540230",

      // Optional
      "author": "Episode Author",                 // Defaults to the `author` field above
      "creator": "Episode Creator",               // Defaults to the `author` field above
      "subtitle": "Episode subtitle",             // Defaults to the episode `description`
      "summary": "Episode summary",               // Defaults to the episode `description`
      "explicit": "no",                           // Can be one of `yes` | `no` | `explicit`.  Defaults to "no"
      "episodeArtUrl": "path/to/episodeImage",    // Defaults to the podcast artwork url
      "itunesTitle": "Episode iTunes title",      // Special title to show in iTunes. Defaults to episode `title`
      "episodeNumber": "42",                      // Automatically generated if not specified.
      "seasonNumber": "2",                        // Defaults to ""
      "episodeType": "Full",                      // `full` | `trailer` | `bonus`. Defaults to `Full`. See the documentation for <itunes:episodeType> on https://help.apple.com/itc/podcasts_connect/#/itcb54353390
      "mediaMimeType": "audio/mpeg",              // Any media mime type. Defaults to "audio/mpeg"
      "mediaIsDefault": "true",                   // Defaults to true
      "medium": "audio"                           // `audio` | `video`. Defaults to `audio`
      "htmlDescription": "<div></div>",           // Defaults to the episode `description`
      "guid": "my.site/episodes/hjhkhl7829hs986", // Defaults to a 32-character random string. Can alternatvely be a URL.
      "guidIsPermalink": "false",                 // `false` by default. Set to `true` if your `guid` is a permalink url
    }
  ]
}

See Also

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/AnalyzePlatypus/podcast_feed_generator.

License

The gem is available as open source under the terms of the MIT License.

About

๐ŸŽ™ Easily generate RSS podcast feeds from a simple JSON object (100% test coverage, compatible with every major podcast player)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published