mirror of
https://github.com/LightAir/turbo-rss.git
synced 2026-02-04 12:06:20 +00:00
changed object names to fit conventions
This commit is contained in:
14
lib/rss.js
14
lib/rss.js
@@ -50,7 +50,7 @@ function generateXML (data){
|
||||
});
|
||||
}
|
||||
|
||||
ifTruePushArray(data.custom, channel, data.custom);
|
||||
ifTruePushArray(data.custom_elements, channel, data.custom_elements);
|
||||
|
||||
data.items.forEach(function(item) {
|
||||
var item_values = [
|
||||
@@ -96,7 +96,7 @@ function generateXML (data){
|
||||
}
|
||||
}
|
||||
|
||||
ifTruePushArray(item.custom, item_values, item.custom);
|
||||
ifTruePushArray(item.custom_elements, item_values, item.custom_elements);
|
||||
|
||||
channel.push({ item: item_values });
|
||||
|
||||
@@ -110,8 +110,8 @@ function generateXML (data){
|
||||
version: '2.0'
|
||||
};
|
||||
|
||||
for(var name in data.customNamespaces) {
|
||||
_attr['xmlns:' + name] = data.customNamespaces[name];
|
||||
for(var name in data.custom_namespaces) {
|
||||
_attr['xmlns:' + name] = data.custom_namespaces[name];
|
||||
}
|
||||
|
||||
//only add namespace if GeoRSS is true
|
||||
@@ -148,8 +148,8 @@ function RSS (options, items) {
|
||||
this.ttl = options.ttl;
|
||||
//option to return feed as GeoRSS is set automatically if feed.lat/long is used
|
||||
this.geoRSS = options.geoRSS || false;
|
||||
this.customNamespaces = options.customNamespaces || {};
|
||||
this.custom = options.custom || [];
|
||||
this.custom_namespaces = options.custom_namespaces || {};
|
||||
this.custom_elements = options.custom_elements || [];
|
||||
this.items = items || [];
|
||||
|
||||
this.item = function (options) {
|
||||
@@ -165,7 +165,7 @@ function RSS (options, items) {
|
||||
lat: options.lat,
|
||||
long: options.long,
|
||||
enclosure: options.enclosure || false,
|
||||
custom: options.custom || []
|
||||
custom_elements: options.custom_elements || []
|
||||
};
|
||||
|
||||
this.items.push(item);
|
||||
|
||||
Reference in New Issue
Block a user