Skip to content
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

confusing documentation: first time running app fails #39

Closed
shuhblam opened this issue Jan 8, 2015 · 5 comments
Closed

confusing documentation: first time running app fails #39

shuhblam opened this issue Jan 8, 2015 · 5 comments

Comments

@shuhblam
Copy link

shuhblam commented Jan 8, 2015

maybe you can help me understand how to fix this

screen shot 2015-01-08 at 6 22 36 pm

running app.js:

var RSS = require('rss');

/* lets create an rss feed */
var feed = new RSS({
    title: 'title',
    description: 'description',
    feed_url: 'http://example.com/rss.xml',
    site_url: 'http://example.com',
    image_url: 'http://example.com/icon.png',
    docs: 'http://example.com/rss/docs.html',
    managingEditor: 'Dylan Greene',
    webMaster: 'Dylan Greene',
    copyright: '2013 Dylan Greene',
    language: 'en',
    categories: ['Category 1','Category 2','Category 3'],
    pubDate: 'May 20, 2012 04:00:00 GMT',
    ttl: '60',
    customNamespaces: {
      'itunes': 'http://www.itunes.com/dtds/podcast-1.0.dtd'
    },
    custom: [
      {'itunes:subtitle': 'A show about everything'},
      {'itunes:author': 'John Doe'},
      {'itunes:summary': 'All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our podcast in the Podcasts app or in the iTunes Store'},
      {'itunes:owner': [
        {'itunes:name': 'John Doe'},
        {'itunes:email': 'john.doe@example.com'}
      ]},
      {'itunes:image': {
        _attr: {
          href: 'http://example.com/podcasts/everything/AllAboutEverything.jpg'
        }
      }},
      {'itunes:category': [
        {_attr: {
          text: 'Technology'
        }},
        {'itunes:category': {
          _attr: {
            text: 'Gadgets'
          }
        }}
      ]}
    ]
});

/* loop over data and add to feed */
feed.item({
    title:  'item title',
    description: 'use this for the content. It can include html.',
    url: 'http://example.com/article4?this&that', // link to the item
    guid: '1123', // optional - defaults to url
    categories: ['Category 1','Category 2','Category 3','Category 4'], // optional - array of item categories
    author: 'Guest Author', // optional - defaults to feed author property
    date: 'May 27, 2012', // any format that js Date can parse.
    lat: 33.417974, //optional latitude field for GeoRSS
    long: -111.933231, //optional longitude field for GeoRSS
    enclosure: {url:'...', file:'path-to-file'}, // optional enclosure
    custom: [
      {'itunes:author': 'John Doe'},
      {'itunes:subtitle': 'A short primer on table spices'},
      {'itunes:image': {
        _attr: {
          href: 'http://example.com/podcasts/everything/AllAboutEverything/Episode1.jpg'
        }
      }},
      {'itunes:duration': '7:04'}
    ]
});

// cache the xml to send to clients
var xml = feed.xml();
@djthread
Copy link

djthread commented Jan 9, 2015

Looks to me like the enclosure filename you specify doesn't exist.

  enclosure: {url:'...', file:'path-to-file'}, // optional enclosure

@shuhblam
Copy link
Author

shuhblam commented Jan 9, 2015

@djthread i guess i missed this in the readme. do you have to specify a file to hold the rss feed?

@dylang
Copy link
Owner

dylang commented Jan 9, 2015

@colegillespie

Look at this line from the example:

enclosure: {url:'...', file:'path-to-file'}, // optional enclosure

Try commenting it out.

@dylang
Copy link
Owner

dylang commented Jan 9, 2015

do you have to specify a file to hold the rss feed?

No, the filename is only for the optional enclosure.

@djthread Thanks for providing support!

@shuhblam
Copy link
Author

shuhblam commented Jan 9, 2015

doh, duh. thanks for specifying. awesome module!

@shuhblam shuhblam closed this as completed Jan 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants