»
EnglishFrenchVietnamese

Print - JavaScript OPML Reader - JavaScriptBank.com

Full version: jsB@nk » Utility » JavaScript OPML Reader
URL: https://www.javascriptbank.com/javascript-opml-reader.html

JavaScript OPML Reader © JavaScriptBank.comThis JavaScript code will display a HTML-formatted version of the OPML feed.

Full version: jsB@nk » Utility » JavaScript OPML Reader
URL: https://www.javascriptbank.com/javascript-opml-reader.html



JavaScript
<script language="JavaScript">////////////////////////////////////////////////////<JavaScript OPML Reader>//// (c) 2003 Premshree Pillai////Written on: 03/07/03 (dd/mm/yy)////http://www.qiksearch.com/////////////////////////////////////////////////////function readOPML(URI) {if(window.ActiveXObject) {var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async=false;}xmlDoc.load(URI);items=xmlDoc;function formatOPML(tree) {document.write('<html><head><title>OPML Reader: '+URI+'</title><style type="text\/css">ul{font-family:verdana,arial; font-size:10pt}</style></head><body>');document.write('<span style="font-family:verdana,arial,helvetica; font-size:8pt"><center><a href="opml-reader.htm"><h3>[Go Back]</h3></a></center>');traverse(tree.documentElement);document.write('</body></html>');}function traverse(tree) {if(tree.hasChildNodes()) {var cFlag=0;var nodes=tree.childNodes.length;if(tree.tagName=="outline") {cFlag=1;document.write('<ul><li>');if(tree.getAttribute("text")!=null)document.write(tree.getAttribute("text"));}for(var i=0; i<nodes; i++)traverse(tree.childNodes(i));if(cFlag)document.write('</li></ul>');} else {if(tree.nodeValue==null) {document.write('<ul><li>');document.write(tree.getAttribute("text"));document.write('</li></ul>');document.write('</div>');}}}if(typeof(xmlDoc)!="undefined")if(window.ActiveXObject) formatOPML(items);}function checkString() {var loc=document.location.href.split("?")if(loc.length>1) {URI=loc[1].split("=");if(URI.length>1) {var retURI="";for(var i=1; i<URI.length; i++) retURI+=URI[i];try {readOPML(unescape(retURI));}catch(e) {}}}}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<body onLoad="checkString();"><table align="center" width="520"><tr><td><center><form name="form1" method="get" action="opml-reader.htm"><b>OPML URI: </b><input type="text" name="URI" value="http://" class="ip"><input type="submit" value="Read OPML" class="btn"></form></center>Enter the URI of the OPML file (e.g: <a href="http://premshree.resource-locator.com/j/rss.xml">http://premshree.resource-locator.com/j/rss.xml</a>) in the above input box and hit the button. This JavaScript will display a HTML-formatted version of the OPML feed.<br><br><b>Note:</b> <ul><li>The script can read <a href="http://www.opml.org">OPML</a> feeds.</li><li>The script assumes that the OPML feed conforms to their specifications.</li><li>This script works with MSIE 4+ only.</li><li>If you enter an invalid URI or some other processing error occurs, the file wont be parsed.</li></ul><hr noshade>© 2003 <a href="http://www.qiksearch.com">Premshree Pillai</a>.</td></tr></table></body><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->