Comments (2)
rssInstance({
custom_elements: [
{
'media:content': [
{
_attr: {
type: 'application/x-shockwave-flash',
medium: 'video',
isDefault: 'true',
expression: 'full',
duration: '117',
url: 'https:,//www.youtube.com/v/XnZ_J3l_0z4',
src: your url
}
},})
something like this should work, yeah?
from node-rss.
The same need here,
This is my solution:
const feedOptions = {
title: '...',
description: "...",
site_url: '...',
feed_url: `...`,
image_url: `...`,
pubDate: new Date(),
copyright: `...`,
custom_namespaces: {
media: "http://search.yahoo.com/mrss/",
}
};
const feed = new RSS(feedOptions);
Important code part that you need to add:
custom_namespaces: {
media: "http://search.yahoo.com/mrss/",
}
Then in your item:
feed.item({
title: "...",
description: "...",
url: "...",
date: "...",
author: "...",
custom_elements: [
{
'media:content': [
{
_attr: {
medium: 'image',
URL: "<YOUR IMAGE URL>"
}
}]
}]
});
Result in the feed:
<media:content medium="image" url="<YOUR IMAGE URL>"> </media:content>
I test with Google RSS feed reader and it is working now!
I think you should write down in your documentation a similar example, it is really useful!
Nowadays images in the feed have 80% of relevance.
(thx to #19 (comment) for the option configuration part)
from node-rss.
Related Issues (20)
- Continuous integration tests doesn't work, node version outdated HOT 4
- Dependency Dashboard
- Escape character breaks XML generator
- Update docs and types to allow `author` in Feed options
- Consider removing fallback value for `site_url`?
- item.categories are not optional
- Error: ENOENT: no such file or directory, stat 'path-to-file' HOT 1
- How to build nested tags? HOT 1
- Error at install HOT 3
- GUID is assumed as not permalink if guid item is provided
- readme.md - managingEditor/author/webMaster should be email addresses
- Language not making it's way to RSS HOT 1
- Create the RSS feed without a CDATA and without CDATA
- Retrieving XML from an RSS feed
- pubDate should not use .toGMTString()
- Support for multiple XML tags with the same name
- Feed doesnโt validate in itunes - itunes:category should have a self closing tag
- How to remove CDATA from title and description? (stitcherFM and w3validator) HOT 6
- can we add a last updated attribute? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-rss.