一、添加一个新的asp文件到网站根目录如:tuisong.asp(名字自己命名)
二、写入下面的代码。并将下面需要更改的几个地方更改,就是汉字部分需要修改的地方,更改成自己想要提交的网站网址和自己的密钥网址
<script language="JScript" runat="Server"> function toObject(json) { eval("var o=" + json); return o; } </script> <% 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.3.0") Http.open "POST",url,false Http.setRequestHeader "CONTENT-TYPE", "text/plain" Http.send(data) if Http.readystate<>4 then exit function End if PostHTTPPage=bytesToBSTR(Http.responseBody,"utf-8") set http=nothing if err.number<>0 then err.Clear End function sitemap = sitemap& "推送网址" &vbcrlf sitemap = sitemap& "推送网址" &vbcrlf sitemap = sitemap& "推送网址" &vbcrlf sitemap = sitemap& "推送网址" html = PostHTTPPage("推送秘钥",sitemap) Response.Write html response.clear %> <% json = html Set json = toObject(json) if instr(html,"success")>0 then Response.Write ("推送成功 "&json.success&" 条;剩余配额 "&json.remain&"条") else Response.Write "推送失败!返回代码 => "&html end if Set json = Nothing %>
三、如何修改格式参考下面链接熊掌号如何用api提交和周级收录的代码以及批量修改链接
四、主动提交数据,
访问你的网站地址加上/tuisong.asp(具体根据自己放的目录和文件名)