• 企业400电话
  • 微网小程序
  • AI电话机器人
  • 电商代运营
  • 全 部 栏 目

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    atom_js.asp
    复制代码 代码如下:

    %                     
    ' I converted some of your example found on http://www.iteam5.net/francesco/atom/ over to jscript. 
    ' Feel free to use it and keep up the good work.
    ' Tyson Kopczynski
    ' tyson@cco.com


               function atom(strURL)
              {
               var objXML = new ActiveXObject("msxml2.DOMDocument.3.0");
               objXML.async = false;
               objXML.setProperty("ServerHTTPRequest", true);
               objXML.validateOnParse = true;
               objXML.preserveWhiteSpace = false;

               if (!objXML.load(strURL))
                {
                 var array = new Array();

                 Response.Write("P>ERRORbr>code: " + objXML.parseError.errorCode)
                 Response.Write("br>Linea/Col: " + objXML.parseError.line  "/" + objXML.parseError.linepos)
                 Response.Write("/P>")

                 return(array)
                }
               else
                {
                 var objNodeList = objXML.getElementsByTagName("entry");
                 var arrDicts = new Array(objNodeList.length);

                 for (var i=0; iobjNodeList.length; i++) 
                  {
                   arrDicts[i] = new ActiveXObject("Scripting.Dictionary");

                   arrDicts[i].Item("issued") = objNodeList[i].getElementsByTagName("issued")[0].firstChild.nodeValue
                   arrDicts[i].Item("id") = objNodeList[i].getElementsByTagName("id")[0].firstChild.nodeValue
                   arrDicts[i].Item("link") = objNodeList[i].getElementsByTagName("link")[1].getAttribute("href")
                   arrDicts[i].Item("author") = objNodeList[i].getElementsByTagName("author")[0].xml
                   arrDicts[i].Item("title") = objNodeList[i].getElementsByTagName("title")[0].firstChild.nodeValue
                   arrDicts[i].Item("content") = objNodeList[i].getElementsByTagName("content")[0].xml
                  }
                 return(arrDicts) 
                }
               }

             var blogURL = "http://taosage-net.blogspot.com/atom.xml";
             var blogItems = atom(blogURL);

             Response.Write("strong>")
             Response.Write("a href='" + blogItems[0].Item("link") + "'>" + blogItems[0].Item("title") + "/a>")
             Response.Write("/strong>")

             Response.Write("table width='100%' cellspacing='0' cellpadding='0'>")
             Response.Write("tr>")
             Response.Write("td width='10' rowspan='2'>nbsp;/td>")
             Response.Write("td>" + blogItems[0].Item("content") + "br>/td>")
                Response.Write("/tr>")
             Response.Write("tr>")
             Response.Write("td>posted by " + blogItems[0].Item("author") + " @ " + blogItems[0].Item("issued") + "/td>")
             Response.Write("/tr>")
             Response.Write("/table>")
            %>


    上一篇:atom2rss.asp
    下一篇:google sitemap.asp
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯 版权所有

    《增值电信业务经营许可证》 苏ICP备15040257号-8

    atom_js.asp atom,js.asp,atom,js.asp,