program code
< %@LANGUAGE="VBSCRIPT " CODEPAGE="65001"%>
<%
option explicit
response.charset = "UTF-8"
session.codepage = 65001
session.timeout = 1440
server.scripttimeout = 9999
'-------------------------------------------------- --------
'Function: ASP automatically obtains matching article tags (Tags) and keywords
'Parameter: strTitle title
' strContent content
'Return: 0: No matching tags Others: A list of tags separated by English half-width commas
'Explanation: The label keyword calls the Discuz label keyword list
'From: http://www.dlstu.cn/code/default.asp?id=1781
'------------------------------------------------ ---
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.downcodes.com
Set XML = server.CreateObject("Microsoft.XMLDOM")
With XML
.async = "false"
.resolveExternals = "false"
.setProperty "ServerHTTPRequest", true
.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
'Application
Response.write ShowTags("Yipin Sky Web Development Code Station ASP and other classic code collection blogs related to Web development - ASP communication QQ group 12814238 (full) 14725152 (open) http://code.dlstu.cn", "Yipin Sky Web Development Code Station ASP and other classic code collection blogs related to Web development - ASP communication QQ group 12814238 (full) 14725152 (open) http://code.dlstu.cn")
%>