podcast RSS feed #3623
RichardJActon
started this conversation in
Feature Requests
Replies: 1 comment
-
I was after a similar sort of thing today: I wanted to provide a RSS feed of manual updates done on a photography site (not a blog). I put together this basic script to generate & then update it programmatically: library(minixml)
# devtools::install_github("coolbutuseless/minixml")
library(anytime)
generate_empty_feed <- function(file = 'index.xml'){
doc <- xml_elem("rss", version="2.0")
channel <- doc$add('channel')
channel$add('title', "Photography")
channel$add('link', "https://photo.com/")
channel$add('description', "My latest photo pages")
cat(as.character(doc), "\n", file= file)
}
import_feed <- function(file = 'index.xml'){
rl <- readLines('index.xml')
minixml::parse_xml_doc(paste(trimws(rl), collapse = '',sep=''))
}
new_entry <- function(feed,
album = 'test',
description = paste("photo album of", album),
title = paste("New album:", album),
link = paste0("https://photo.com/", album),
guid = paste0("photo.com/", album),
pubDate = rfc2822( anytime(Sys.time()) )){
channel <- feed$children[[1]]
item <- xml_elem('item')
item$add("title", title)
item$add('link', link)
item$add('guid', guid)
item$add('pubDate', pubDate)
item$add('description', description)
channel$append(item)
return(feed)
}
update_feed <- function(feed, file = 'index.xml'){
cat(as.character(feed),"\n", file= file)
}
# generate_empty_feed() # only first time
feed <- import_feed()
new_feed <- new_entry(feed, album = 'test')
new_feed
update_feed(new_feed) It wouldn't be too hard to adapt it to read in a yaml input instead, and I guess using a more portable language for broader accessibility. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It'd be very cool to be able to easily generate a podcast RSS feed from Quarto
maybe some YAML options that can alter the xml for the rss feed an have it include tags from the new podcast namespace:
https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md
And maybe also have an embedded player on each episode page based on a nice open source player like podverse
https://github.com/podverse/
https://podverse.fm/embed/player-demo-custom-css
e.g.
EDIT:
I think some edits would need to be made in the yaml schema definitions:
quarto-cli/src/resources/schema/definitions.yml
Line 1519 in 4ca7321
and judging by this:
quarto-cli/src/project/types/website/listing/website-listing-feed.ts
Line 510 in 4ca7321
possibly also this EJS template: https://github.com/quarto-dev/quarto-cli/blob/4ca7321584065f0b2632160cf03ff32c42e5a78f/src/resources/projects/website/listing/feed/item.ejs.md
So that the correct XML is generated for a podcast feed
See also: #8474
Beta Was this translation helpful? Give feedback.
All reactions