18631817090
熊掌号asp方式资源提交
发表日期:2018/9/28  作者:勤快牛网络 浏览:
熊掌号asp方式资源提交
自熊掌号出现后,很多做seo的朋友非常注重熊掌号的培养。熊掌号的资源提交是网站优化非常重要的环节,不仅可以提高熊掌号指数,而且可以有效的提升排名。
熊掌号的资源提交主要有两种方式:API提交、手动提交
手动提交略微麻烦一些,每次都写完文章后我们需要登录熊掌号搜索资源平台,填写url在进行提交。如果能在网站中直接提交就再好不过了,那就需要使用api提交
但是api提交需要有一定的开发能力,API中的推送示例只有curl推送示例、post推送示例、php推送示例、ruby推送示例,这对于asp的网站来说有点不公平。在这里为了大家节约时间,我将熊掌号asp方式资源提交示例奉献给大家
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("
"&PostHTTPPage&"
")
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)
执行完毕后看看显示结果是否正常,然后看看你资源提交配额是不是减少了,如果减少则标称重。
祝君好运,如果对你有帮助欢迎在下方给个赞。