欢迎访问万博易官网

百度站长

百度站长主动(实时)网址批量推送

发布时间:2020-05-03 18:59

如果自己喜欢动手的话,可以参考以下代码,来自己写

python2.7版本推送代码

#! /usr/bin/env python #coding=utf-8 #百度推送 by tools.bugscaner.com import httplib data = open("sitemap.txt","r").read() allurls = data.split("\n") nbs = len(allurls) if nbs/2000*2000 != nbs: all = nbs/2000 + 1 else: all = nbs/2000 for x in range(1,all+1): urlinfos ="\n".join(allurls[(x-1)*2000:x*2000]) headers = {"Content-Type":"application/x-www-form-urlencoded"} conn = httplib.HTTPConnection("data.zz.baidu.com") try: conn.request("POST","/urls?site=tools.bugscaner.com&token=QesN4asTDZH1bjfq",urlinfos,headers) httpres = conn.getresponse() html = httpres.read() print html except Exception,e: print e

php版本推送代码

$urls = array( 'http://www.example.com/1.html', 'http://www.example.com/2.html', ); $api = 'http://data.zz.baidu.com/urls site=tools.bugscaner.com&token=QesN4asTDZH1bjfq'; $ch = curl_init(); $options = array( CURLOPT_URL => $api, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => implode("\n", $urls), CURLOPT_HTTPHEADER => array('Content-Type: text/plain'), ); curl_setopt_array($ch, $options); $result = curl_exec($ch); echo $result;

ruby推送示例

require 'net/http' urls = ['http://www.example.com/1.html', 'http://www.example.com/2.html'] uri = URI.parse('http://data.zz.baidu.com/urls site=www.xxx.com&token=eTk7ychrWZP1pDQD') req = Net::HTTP::Post.new(uri.request_uri) req.body = urls.join("\n") req.content_type = 'text/plain' res = Net::HTTP.start(uri.hostname, uri.port) { |http| http.request(req) } puts res.body

如果以上环境您都没有安装...

步骤1:安装火狐浏览器 步骤2:然后安装附件 hackbar 步骤3:post提交您的网址即可! 简单吧,如果不想折腾,就直接用这个页面提交吧! 其实我也是为了方便自己提交写的!O(∩_∩)O

TAG标签:百度(217)站长(22)网址(8)推送(5)主动(14)批量(5)实时(8)

上一篇:上一篇:百度统计站长交流会武汉站即将启动

下一篇:下一篇:没有了