程序代碼
<%@LANGUAGE="VBSCR<%
option explicit
response.charset = "UTF-8"
session.codepage = 65001
session.timeout = 1440
server.scripttimeout = 9999
'----------------------------------------------------
'功能: asp自動獲取匹配文章標簽(Tags)、關鍵字
'參數: strTitle 標題
' strContent 內容
'返回: 0:無匹配標簽 其他:以英文半角逗號分隔的標簽列表
'說明:標簽關鍵字調用Discuz標簽關鍵字列表
'From:Function ShowTags(ByVal strTitle, ByVal strContent)
Dim xml, objNodes, XMLPath, i
strTitle = Server.URLEncode(strTitle)
strContent = Server.URLEncode(strContent)
XMLPath="http://keyWord.discuz.com/related_kw.html?title="&strTitle&"&content="&strContent&"&ics=utf-8&ocs=utf-8"
'From:http://www.companysz.com
Set XML = server.CreateObject("Microsoft.XMLDOM")
With XML
.async = "false"
.resolveExternals = "false"
.set .load(XMLPath)
If .getElementsByTagName("info")(0).selectSingleNode("count").Text > 0 Then
Set objNodes = .getElementsByTagName("item")
For i = 0 to objNodes.length - 1
ShowTags = ShowTags & Trim(objNodes(i).selectSingleNode("kw").Text)&","
Next
Set objNodes = Nothing
ShowTags = Left(ShowTags,Len(ShowTags)-1)
Else
ShowTags = 0
End If
End With
Set XML = Nothing
End Function
'應用
Response.write ShowTags("逸品天空Web開發代碼站ASP及其他Web開發相關經典代碼收集博客 - ASP交流QQ群12814238(滿) 14725152(開放)http://code.dlstu.cn","逸品天空Web開發代碼站ASP及其他Web開發相關經典代碼收集博客 - ASP交流QQ群12814238(滿) 14725152(開放)http://code.dlstu.cn")
%>
新聞熱點
疑難解答