@conshax-shared/podcast-partytime
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

DISCLAIMER, PLEASE READ

This is a fork of the original podcast-partytime to make the package usable in client-side applications.

In order to make this work we dropped all backend dependencies and therefore also had to remove a lot of the package's tests.

Please use this package with caution and don't expect the same stability as the original package.

Partytime Podcast Parser

NPM version

Podcast feed parser, originally extracted from podcast index - https://github.com/Podcastindex-org/aggregator/tree/master/partytime. It is up to you, the consumer of this package, to fetch the feed which needs to be parsed. When fetching the feed YOU SHOULD INCLUDE A PROPER USER-AGENT. You can test by fetching and checking the description of https://podnews.net/rss.

This package will also identify new namespace elements and call out the "phases" implemented by the feed in a pc20support element.

Usage

npm install podcast-partytime

Typescript

import fetch from "node-fetch";
import pt from "podcast-partytime";

// Check CORS support
pt.checkFeedByUri("https://www.spreaker.com/show/3128218/episodes/feed").then(console.log);

fetch("http://mp3s.nashownotes.com/pc20rss.xml", {
  headers: {
    "user-agent": "partytime/example",
  },
})
  .then((resp) => resp.text())
  .then((xml) =>
    console.log(
      pt.checkFeedByObject({
        uri: "http://mp3s.nashownotes.com/pc20rss.xml",
        feedObject: pt.parseFeed(xml),
      })
    )
  );

// Parse Feed
fetch("http://mp3s.nashownotes.com/pc20rss.xml", {
  headers: {
    "user-agent": "partytime/example",
  },
})
  .then((resp) => resp.text())
  .then((xml) => console.log(pt.parseFeed(xml)));

Javascript

const fetch = require("node-fetch");
const pt = require("podcast-partytime");

// Check CORS support
pt.checkFeedByUri("https://www.spreaker.com/show/3128218/episodes/feed").then(console.log);

fetch("http://mp3s.nashownotes.com/pc20rss.xml")
  .then((resp) => resp.text())
  .then((xml) =>
    console.log(
      pt.checkFeedByObject({
        uri: "http://mp3s.nashownotes.com/pc20rss.xml",
        feedObject: pt.parseFeed(xml),
      })
    )
  );

// Parse Feed
fetch("http://mp3s.nashownotes.com/pc20rss.xml")
  .then((resp) => resp.text())
  .then((xml) => console.log(pt.parseFeed(xml)));

Resources

Sample Feeds

The sample feeds below were chosen for their varied nature. Including things like non-traditional titles, different publishers, and season usage.

Development

Update dependencies (person enum and valid license list) via yarn deps or npm run deps.

Package Sidebar

Install

npm i @conshax-shared/podcast-partytime

Weekly Downloads

2

Version

0.1.1

License

MIT

Unpacked Size

964 kB

Total Files

87

Last publish

Collaborators

  • conshax_podcast