Kolomona / PodcastFeedHandler

A Java library to read and write podcast feeds.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PodcastFeedHandler

Run Gradle on Push

A Java library to read and write podcast feeds. This library took a lot of inspiration from MarkusLewis - Podcast Feed Library. They made a great library, but I wanted to be able to create feed, as well as read them; their library was very good for reading, but would need a lot of work to make it a writing library.

Key Features

  • Reading/Writing Podcast feeds, reading local files and remote
  • Java 11+ compatible
  • Tested, Built, Signed, and Published with GitHub actions to Maven Central
  • No dependencies, 100% self contained and native code

Progress

Reading and writing seems to be working, going to use in projects I have and document more.

Future plans

Add support for http://search.yahoo.com/mrss/ and http://www.rawvoice.com/rawvoiceRssModule/ xml standards like sn.xml contain.

Getting Started

Installation

This library is available in Maven Central!

Gradle

implementation group: 'co.ntbl', name: 'podcastfeedhandler', version: '0.1.1'

Maven

<dependency>
    <groupId>co.ntbl</groupId>
    <artifactId>podcastfeedhandler</artifactId>
    <version>0.1.1</version>
</dependency>

Reading a feed

String doc = getRawStringFromAssets("planetmoney.xml");
PodcastFeedReader podcastFeedReader = new PodcastFeedReader();

Podcast fromDoc;
try {
    fromDoc = podcastFeedReader.getPodcastFromDocument(doc);
} catch (MalformedURLException | PodcastFeedException e) {
    throw new RuntimeException(e);
}

Writing a feed

// The required fields are title, description, iTunes Image (artwork), language, iTunes categories,
// iTunes is explicit.
Podcast myPodcast = new Podcast("My awesome podcast", "Podcast about my breakfast",
        "http://ntbl.co/image.jpg", "en-US", "Society &amp; Culture|Personal Journals",
        "true");

Episode singleEpisode = new Episode("My big Omelet", "https://ntbl.co/media/1.mp3", 9234751L, "audio/mpeg");
myPodcast.addEpisode(singleEpisode);

PodcastFeedWriter podcastFeedWriter = new PodcastFeedWriter();
String xml;
try {
    xml = podcastFeedWriter.getXml(myPodcast);
} catch (ParserConfigurationException | TransformerException e) {
    throw new RuntimeException(e);
}

Development

Checking for testing library updates

Using the gradle wrapper, you can call 'dependencyUpdates' to have a plugin check for available updates.

./gradlew dependencyUpdates

Checking dependency health

Using another plugin with gradle we can call the following code to see the health of our gradle project.

./gradlew projectHealth

Support

JetBrains Logo (Main) logo.

Jetbrains supports this project through their Open Source Development - Community Support Program.

About

A Java library to read and write podcast feeds.

License:MIT License


Languages

Language:Java 100.0%