Skip to content
Browse files

added support for slashdot backslash.xml

  • Loading branch information...
1 parent b107a6d commit f5753eab01ab67ead6214006a72d5272e49ca800 Andris Reinman committed
Showing with 13 additions and 5 deletions.
  1. +1 −0 .gitignore
  2. +11 −4 lib/nodepie.js
  3. +1 −1 package.json
View
1 .gitignore
@@ -0,0 +1 @@
+node_modules
View
15 lib/nodepie.js
@@ -196,7 +196,7 @@ NodePie.prototype._checkEncoding = function(xml){
**/
NodePie.prototype._checkType = function(){
var root_keys = Object.keys(this.feed), key, type, elem;
-
+
for(var i=0, len = root_keys.length; i<len; i++){
key = root_keys[i];
@@ -228,6 +228,13 @@ NodePie.prototype._checkType = function(){
this.itemsElement = elem.item || [];
break;
}
+ else if(type === "backslash"){
+ this.feedType = "backslash";
+ this.rootElement = elem;
+ this.channelElement = elem;
+ this.itemsElement = this.channelElement.story || [];
+ break;
+ }
}
if(!this.rootElement){
@@ -609,7 +616,7 @@ NodePie.Item.prototype.getLink = function(rel, type){
rel = rel || "alternate";
type = type || "text/html";
- var link = this.element.link;
+ var link = this.element.link || this.element.url;
if(!link){ }
@@ -729,7 +736,7 @@ NodePie.Item.prototype.getDate = function(){
return this.feed._processDate(
this.element.pubDate || this.element.published || this.element.created || this.element.issued ||
- this.element.updated || this.element.modified || (dcns && this.element[dcns+":date"])
+ this.element.updated || this.element.modified || (dcns && this.element[dcns+":date"]) || this.element.time
);
};
@@ -816,7 +823,7 @@ NodePie.Item.prototype.getCategory = function(){
NodePie.Item.prototype.getCategories = function(){
var category, categories = [], dcns = this.feed.namespaces[NodePie.NS.DC];
- category = this.element.category || this.element[dcns+":subject"];
+ category = this.element.category || this.element[dcns+":subject"] || this.element.department;
if(!category){ }
View
2 package.json
@@ -1,7 +1,7 @@
{
"name": "nodepie",
"description": "RSS/Atom parser for Node.JS",
- "version": "0.3.1",
+ "version": "0.4.0",
"author" : "Andris Reinman",
"maintainers":[
{

0 comments on commit f5753ea

Please sign in to comment.
Something went wrong with that request. Please try again.