-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
supports media:content #19
Comments
@dylang Is there any update on this? I would like to add |
Sorry it has taken so long to get feedback on your request. I think this is a great idea. |
Perhaps a configurable whitelist of namespaces to be passed through on XML generation? |
I think it can be done with #35 |
That PR works well for adding custom namespaces, but how could I implement the output of custom media elements like this (as found in a Wordpress RSS feed)?
|
FYI This is my code for adding media:content using this PR: var newfeed = new RSS(options);
var itemOptions = {
title : item.title,
description : item.description,
url : item.link,
guid : item.link,
author : item.author,
pubdate : item.pubdate,
custom_elements : [
{"wfw:comments": item["wfw:commentrss"]["#"]}
]
};
// add in media info if present
if (item["media:content"]["@"]) {
var media = item["media:content"]["@"];
var image_custom_element = {
"media:content": {
_attr: {
medium : media.medium,
href : media.url,
height : media.height,
width : media.width
}
}
};
itemOptions.custom_elements.push(image_custom_element);
}
newfeed.item(itemOptions); |
I think, this is the piece of code you're looking for: var image_custom_element = {
"media:content": [{
_attr: {
medium: media.medium,
href: media.url,
height: media.height,
width: media.width
}
}, {
"media:thumbnail": {
_attr: {
medium: media.thumb.medium,
href: media.thumb.url,
height: media.thumb.height,
width: media.thumb.width
}
}
}]
} outputs <media:content medium="media.medium" href="media.url" height="media.height" width="media.width">
<media:thumbnail medium="media.thumb.medium" href="media.thumb.url" height="media.thumb.height" width="media.thumb.width" />
</media:content> |
That is working for me. Thanks much! Love to see #35 merged. |
Closing this as it is working using the code sample provided as of #35 (version 1.1.0) |
I get this errror in chrome
somehow I need to add: |
@chovy i ran into this issue, you need to use
|
Is there already a way to use output media:content instead of the enclosure tags for the images?
Thanks
The text was updated successfully, but these errors were encountered: