atom_js.asp
网络编程 2021-07-05 10:58www.168986.cn编程入门
代码如下:
<%
' I converted some of your example found on http://.iteam5./francesco/atom/ over to jscript.
' Feel free to use it and keep up the good work.
' Tyson Kopczynski
' tyson@o.
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>ERROR<br>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; i<objNodeList.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-.blogspot./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'> </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>")
%>
上一篇:google sitemap.asp
下一篇:atom2rss.asp
编程语言
- 如何快速学会编程 如何快速学会ug编程
- 免费学编程的app 推荐12个免费学编程的好网站
- 电脑怎么编程:电脑怎么编程网咯游戏菜单图标
- 如何写代码新手教学 如何写代码新手教学手机
- 基础编程入门教程视频 基础编程入门教程视频华
- 编程演示:编程演示浦丰投针过程
- 乐高编程加盟 乐高积木编程加盟
- 跟我学plc编程 plc编程自学入门视频教程
- ug编程成航林总 ug编程实战视频
- 孩子学编程的好处和坏处
- 初学者学编程该从哪里开始 新手学编程从哪里入
- 慢走丝编程 慢走丝编程难学吗
- 国内十强少儿编程机构 中国少儿编程机构十强有
- 成人计算机速成培训班 成人计算机速成培训班办
- 孩子学编程网上课程哪家好 儿童学编程比较好的
- 代码编程教学入门软件 代码编程教程