New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@download/podcastjs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@download/podcastjs

podcast.js fetches and parses podcast RSS fields so you don't have to!

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

podcast.js

podcast.js fetches and parses podcast RSS fields so you don't have to!

Plus, it comes with TypeScript typings out of the box.

This is based on justinvos version, but uses a slightly different API which enables it to omit most of the dependencies. Also has bugfixes related to parsing guids.

Install

Yarn:

yarn add @download/podcastjs

NPM:

npm install @download/podcastjs

Getting Started

Plain JavaScript:

const { parsePodcast } = require('@download/podcastjs')

const serialRssUrl = 'http://feeds.serialpodcast.org/serialpodcast'

podcastJs.parsePodcast(serialRssUrl).then((podcast) => {
  console.log(podcast.title)
})

TypeScript:

import { parsePodcast, Podcast } from '@download/podcastjs'

const res = await fetch('http://feeds.serialpodcast.org/serialpodcast')
const serialRss = await res.text()

parsePodcast(serialRss).then((podcast: Podcast) => {
  console.log(podcast.title)
})

Documentation

parsePodcast

Parse a string comprising an XML-RSS file.

parsePodcast(rssFileContents)

Parameters:

  • rssFileContents - The podcast's RSS feed's contents

Returns a Podcast object (defined below)

Podcast

Properties
  • title - The title of the podcast e.g. "Serial"
  • description - A description of the podcast e.g. "Serial is a podcast from the creators of..."
  • episodes - A list of Episode objects associated with this Podcast (defined below)

Optional Properties:

  • date - The publication date of the podcast feed as a Date object
  • url - The URL of the podcast's RSS feed e.g. "http://feeds.serialpodcast.org/serialpodcast"
  • image - The podcast's image e.g. "https://serialpodcast.org/sites/all/modules/custom/serial/img/serial-itunes-logo.png"

Episode

Properties
  • title - The title of the episode e.g. "S01 Episode 01: The Alibi"
  • description - A description of the podcast e.g. "It's Baltimore, 1999. Hae Min Lee, a popular high-sch..."
  • audio - The URL of the audio file for this episode e.g. "https://dts.podtrac.com/redirect.mp3/dovetail.prxu.org/serial/d7f03a15-be26-4634-8884-5fadd404ad75/serial-s01-e01.mp3"
  • index - The physical ordering of this episode in the RSS feed e.g. 28
  • guid - A human-defined global identifier e.g. s02-e11

Optional Properties

  • date - The publication date of the podcast feed as a Date object
  • image - The podcast's image e.g. "https://serialpodcast.org/sites/all/modules/custom/serial/img/serial-itunes-logo.png"

Keywords

FAQs

Package last updated on 08 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc