<%
if Request("caiji_url")="" then
%>
<%else%>
<script language="JScript" runat="Server">
function toObject(json) {
eval("var o=" + json);
return o;
}
</script>
<%
response.Charset="GB2312"
Response.Expires = -9999
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "cache-ctrol","no-cache"
caiurl="http://api.sinmeng.net/api/caiji/caiji.php?url="&Request("caiji_url")&"&key=你的key"
Function GetBody(weburl)
Dim ObjXMLHTTP
Set ObjXMLHTTP=Server.CreateObject("MSXML2.serverXMLHTTP")
ObjXMLHTTP.Open "GET",weburl,False
ObjXMLHTTP.send
While ObjXMLHTTP.readyState <> 4
ObjXMLHTTP.waitForResponse 10000
Wend
GetBody=ObjXMLHTTP.responseBody
Set ObjXMLHTTP=Nothing
End Function
Function BytesToBstr(body,Cset)
'-----------------
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
'-----------------
End Function
pcontent=BytesToBstr(GetBody(caiurl),"gbk")
'response.write(pcontent)
Dim json
json = pcontent
Set json = toObject(json)
'Response.Write json.title & " <br/>"
'Response.Write json.content & " <br/>"
caiji_title = json.title
caiji_content = json.content
Set json = Nothing
%>
<%end if%>