knitr::opts_chunk$set(echo = TRUE)
podr
is a very simple package containing two functions for reading and cleaning data from a podcast feed.
devtools::install_github("erramirez/podr")
podr
is primarily composed of two functions:
readpod
, will extract relevant information from a podcast feed according to the information available within the item node. Additionally, it will read and append the podcast title according to what is present in channel/title.cleapod
, will read a data frame created with readpod
and reduce to a tibble with four variables:cleanpod
is primarily used to clean up the date and duration information in a podcast feed in order to make it computable.
Let't say you were really interested in learning how much time you spent listening to your favorite podcast, Jordan, Jesse Go!, in 2017.
First we would use readpod
to read the podcast feed.
library(podr) jjgo <- readpod("http://thornmorris.libsyn.com/rss") jjgo
Not sure how to get the rss feed url for your podcast and useing iTunes? Check out this tip.
We can then use cleanpod
to clean up the podcast data to something usable to answer our question.
jjgoclean <- cleanpod(jjgo) jjgoclean
Now that we have a cleaned data set that contains all the relevant information we can use a few simple tidy tools.
library(tidyverse) library(lubridate) jjgoclean2k17 <- jjgoclean %>% filter(date > "2016-12-31" & date < "2018-01-01") #find the total duration of Jordan, Jesse GO! in seconds sum(jjgoclean2k17$showlength) #find the total as a period seconds_to_period(sum(jjgoclean2k17$showlength))
So there you have it. You can use podr
to find out Jordan, Jesse GO! put out 2d 18H 52M 7S of hilarious shows in 2017.
v0.2.0: 2018-01-30. Updated to accept rss feeds that store duration in seconds in addition to v0.1.0 support for hh:mm:ss or mm:ss.
Please feel free to share issues, notes, and ideas. This is my first public R package and I'd love to learn from you.
made with RStudio and ❤️ in ☀️ Los Angeles
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.