Comparing version 0.4.5 to 0.4.6
@@ -1,2 +0,2 @@ | ||
var myProductName = "opmltojs"; myVersion = "0.4.5"; | ||
var myProductName = "opmltojs"; myVersion = "0.4.6"; | ||
@@ -39,2 +39,9 @@ /* The MIT License (MIT) | ||
function parse (opmltext, callback) { | ||
function addGenerator (theOpml) { //follow the example of RSS 2.0 | ||
try { | ||
theOpml.head.generator = myProductName + " v" + myVersion; | ||
} | ||
catch (err) { | ||
} | ||
} | ||
function convert (sourcestruct, deststruct) { | ||
@@ -86,2 +93,3 @@ var atts = sourcestruct ["$"]; | ||
convert (jstruct.opml, theOutline.opml); | ||
addGenerator (jstruct.opml); //8/6/17 by DW | ||
callback (theOutline); | ||
@@ -88,0 +96,0 @@ }); |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "0.4.5", | ||
"version": "0.4.6", | ||
"main": "opmltojs.js", | ||
@@ -9,0 +9,0 @@ "repository": { |
@@ -9,4 +9,6 @@ ## opmlToJs package | ||
opmlToJs is an attempt to once and for all solve the problem of making it really easy to read OPML files in JavaScript apps. | ||
opmlToJs makes it easy to read and write OPML files in Node apps. | ||
The basic idea: Pass in some OPML text, get back a JavaScript object. And the other way works too. | ||
It builds on <a href="https://github.com/Leonidas-from-XIV/node-xml2js">xml2Js</a>. | ||
@@ -16,3 +18,3 @@ | ||
See the <a href="https://github.com/scripting/opmlToJs/blob/master/test.js">test.js</a> app for an example of how to call it. | ||
See the <a href="https://github.com/scripting/opmlToJs/tree/master/examples/readstates">readstates</a> app for an example of how to call it. | ||
@@ -27,3 +29,5 @@ ### Updates | ||
Add a <i>generator</i> element to the head section after we parse the OPML text, following the <a href="http://cyber.harvard.edu/rss/rss.html#optionalChannelElements">example</a> of RSS 2.0. | ||
Commented some debugging code. | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7690
127
31