复制代码 代码如下:
<title>雷锋|优酷-专辑 采集程序</title></head>
<form name="form1" method="post" action="?action=add">
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder">
<tr><th colspan="2" align="center" class="tableHeaderText"><<<< <font color=red>雷锋|优酷-专辑 采集程序</font> >>>></td></tr>
<tr><td align="center"><a href="http://www.youku.com/playlist/" target="_blank">点我查找优酷专辑</a>
</td>
</tr>
<tr><td bgcolor="#FFFFFF" align="center">专辑地址:<input name="maxz" type="text" value="<%=Request("maxz")%>" size="50"></td></tr>
<tr><td align="center" bgcolor="#FFFFFF">例如专辑:http://www.youku.com/playlist_show/id_2344971.html</td></tr>
<tr><td align="center" bgcolor="#FFFFFF"><input name="action" type="submit" id="action" value="提交分析该专辑地址"></td></tr>
<tr><td align="center" bgcolor="#FFFFFF"></td></tr>
</table>
</form>
<%
if Request("action")="add" Then
maxz=request.Form("maxz")
v_urla=Split(maxz,"/id_")(1)
v_urlb=Replace(v_urla,".html","")
v_url="http://www.youku.com/playlist/rss/id/4014024"&v_urlb
response.write "<div align=""center""><a href="&v_url&" target=_blank >当前专辑的XML:"&v_url&"</a></div>"
Function GetPageContent(Url)
Dim HTTPObj
On Error Resume Next
Set HTTPObj = Server.CreateObject("Microsoft.XMLHTTP")
With HTTPObj
.Open "Get", Url, False, "", ""
.Send
End With
if HTTPObj.Readystate <> 4 then
Set HTTPObj = Nothing
GetPageContent = False
Exit Function
end if
GetPageContent = replace(HTTPObj.responseText,"UTF-8","gb2312")
Set HTTPObj = Nothing
End Function
strXML=GetPageContent(""&v_url&"")
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.validateonparse = true
objXML.async=false
objXML.loadXML(strXML)
set objRootElement = objXML.documentElement
if not isObject(objRootElement) then
Response.Write("no file loaded")
else
Set ChannelList=objXML.getElementsByTagName("item")
if isnull(objXML.getElementsByTagName("item") ) then
response.Write("读取失败")
response.End()
else
Set Statistics=objXML.getElementsByTagName("title")
set KeywordList=objXML.getElementsbytagname("lastBuildDate")
'response.write "共有:"&keywordlist.length-1&"个频道"
'response.write "<div align=""center""><h4>专辑名称:"&Statistics.item(0).text&"</h4>"
v_name=REPLACE(Statistics.item(0).text,"优酷-专辑-","")
zt_name=REPLACE(v_name,"的视频","")
response.write "<div align=""center""><h4>专辑名称:<font color=red>"&zt_name&"</font></h4>"
内容版权声明:除非注明,否则皆为本站原创文章。