Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Added itunes keyword support, and added lastBuildDate to valid date fields #31

wants to merge 1 commit into from

2 participants


No description provided.


lastBuildDate is incorrect (the parser converts element and attribute names to lowercase) and duplicative (look a few lines above your case identifier). With respect to the logic in the statement, I disagree with the advisability of adding lastbuilddate. This is not a reflection on you -- it's not possible to know why I wrote that section of code the way it's written because it's not documented or tested. But basically, if the 'lastbuilddate' is present, it gets assigned to the date variable. Then, if is not already set, the date variable gets assigned to, otherwise it's thrown away because there is a more preferred date. Well, not exactly thrown away -- it would be available as meta['rss:lastbuilddate']. And actually, in the case of the 'lastbuilddate' (an RSS element), the other alternatives shouldn't exist because they're Atom elements.

The keywords support looks fine, but please do three things:

  1. Rebase against the current master -- I just released a major change.
  2. Remove case('keywords'): -- There is no such element, as far as I'm aware.
  3. Make sure you .trim() the results of your split. For example:
keywordstring.split(',').map(function(kw){ return kw.trim(); });

And if you want to enhance that a little further, look at how I handle categories, and see if you can make sure that if both 'itunes:keywords' and 'media:keywords' contain keywords, one does not overwrite the other but rather adds to the array.

Thanks for the pull request! :+1:

p.s. To update your pull request without making a new one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 24, 2012
  1. @blackgold9
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 0 deletions.
  1. +9 −0 main.js
9 main.js
@@ -521,6 +521,7 @@ FeedParser.prototype.handleMeta = function handleMeta (node, type, options) {
+ case('lastBuildDate'):
var date = utils.get(el) ? new Date(el['#']) : null;
if (!date) break;
@@ -604,6 +605,14 @@ FeedParser.prototype.handleMeta = function handleMeta (node, type, options) {
if (utils.get(el['@'], 'uri'))
meta.generator += meta.generator ? ' (' + el['@'].uri + ')' : el['@'].uri;
+ case('itunes:keywords'):
+ case('media:keywords'):
+ case('keywords'):
+ if(!meta.keywords) {
+ var keywordstring = utils.get(el);
+ meta.keywords = keywordstring.split(',');
+ }
+ break;
Something went wrong with that request. Please try again.