|
主题:[ICMS]官方有开发熊掌号的API计划吗? [收藏主题] | 转到: |
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 function postHTTPPage(url,data) dim Http set Http=server.createobject("MSXML2.SERVERXMLHTTP") Http.open "POST",url Http.setRequestHeader "CONTENT-TYPE", "text/plain" 'Http.setRequestHeader "User-Agent", "curl/7.12.1" 'Http.setRequestHeader "Content-Length", "83" Http.send(data) if Http.readystate<>4 then exit function End if PostHTTPPage=bytesToBSTR(Http.responseBody,"utf-8") response.Write("<div style='padding-top:100px; font-size:24px; text-align:center; color:#d00;'>"&PostHTTPPage&"</div>") set http=nothing if err.number<>0 then err.Clear End function 然后调用函数即可 postData = "http://www.hbap.net/News/4213581330.html" postUrl = "http://data.zz.baidu.com/urls?appid=xxxx&token=xxxxx&type=realtime" call postHTTPPage(postUrl,postData) 这个是代码 但是我不知道该加到哪里。 |
|
支持(0) | 反对(0) 顶端 底部 |
支持(0) | 反对(0) 顶端 底部 |
Dim rs
Dim url Dim x Dim arr Dim list <!--查询当天产生数据的 Fname--> Set rs=Conn.Execute("select Fname from KS_Article where adddate >= date() and adddate < DateAdd('d', 1, date())") <!--字符串拼接放到list 中--> url="http://www.xxx.com/news_" arr = rs.GetRows() for each x in arr list = list&url&x&"<br>" next postUrl = "http://data.zz.baidu.com/urls?appid={id}&token={token }&type=realtime" call postHTTPPage(postUrl, list) 我这样显示提交了,但是只提交了一条 ,提交多条数据提交怎么写 |
|
支持(0) | 反对(0) 顶端 底部 |
<上一主题 | 下一主题 > |