<!-- #include file="codePage.asp" -->
<%
	Response.Charset="gb2312"

mudi = trim(request.querystring("mudi"))

Select Case mudi
	Case "getKeyWord"
		response.write(GetKeyWord(trim(request.querystring("theme")),trim(request.querystring("content"))))

	Case "getUrlencode"
		response.write(server.URLEncode(request.querystring("str")))

End Select


' 获取关键字(标签)
Function GetKeyWord(ByVal strTitle, ByVal strContent)
	Dim xml, objNodes, XMLPath, i
	strTitle = Server.URLEncode(strTitle)
	strContent = Server.URLEncode(strContent)
	' http://keyword.discuz.com/related_kw.html?title=你的标题&content=你的内容&ics=输入时的编码&ocs=输出时的编码。
'	XMLPath="http://keyWord.discuz.com/related_kw.html?title="& strTitle &"&content="& strContent &"&ics=utf-8&ocs=utf-8"
	XMLPath="http://keyWord.discuz.com/related_kw.html?title="& strTitle &"&content="& strContent &"&ics=gbk&ocs=gbk"
	'From：http://www.knowsky.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
					GetKeyWord = GetKeyWord & Trim(objNodes(i).selectSingleNode("kw").Text)&","
				Next
				Set objNodes = Nothing
				GetKeyWord = Left(GetKeyWord,Len(GetKeyWord)-1)
			Else
				GetKeyWord = 0
			End If
		End With
	Set XML = Nothing
End Function

%>