Generating the RSS — PodGen Documentation

# Generating the RSS

Once you’ve added all the information and episodes, you’re ready to take the final step:

    rssfeed = p.rss_str()
    # Print to stdout, just as an example
    print(rssfeed)

If you’re okay with the default parameters of `podgen.Podcast.rss_str()`, you can use a shortcut by converting your `Podcast` to `str`:

    rssfeed = str(p)
    print(rssfeed)
    # Or let print convert to str for you
    print(p)

`rss_str`([minimize, encoding, xml_declaration]) | Generate an RSS feed and return the feed XML as string.

You may also write the feed to a file directly, using `podgen.Podcast.rss_file()`:

    p.rss_file('rss.xml', minimize=True)

`rss_file`(filename[, minimize, encoding, ...]) | Generate an RSS feed and write the resulting XML to a file.

Note

If there are any mandatory attributes that aren’t set, you’ll get errors when generating the RSS.

Note

Generating the RSS is not completely free. Save the result to a variable once instead of generating the same RSS over and over.