- curl -H 'Content-Type:text/plain' --data-binary @urls.txt
- "http://data.zz.baidu.com/urls?site=www.example.com&token=edk7yc4rEZP9pDQD"
- POST /urls?site=www.58.com&token=edk7ychrEZP9pDQD HTTP/1.1
- User-Agent: curl/7.12.1
- Host: data.zz.baidu.com
- Content-Length: 83
- http://www.example.com/1.html
- http://www.example.com/2.html
- $urls = array(
- 'http://www.example.com/1.html',
- 'http://www.example.com/2.html',
- );
- $api = 'http://data.zz.baidu.com/urls
- site=www.58.com&token=edk7ychrEZP9pDQD';
- $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;
- 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
- <script>
- (function(){
- var bp = document.createElement('script');
- bp.src = '//push.zhanzhang.baidu.com/push.js';
- var s = document.getElementsByTagName("script")[0];
- s.parentNode.insertBefore(bp, s);
- })();
- </script>
- <?php include_once("baidu_js_push.php") ?>
欢迎光临 得知互动 (https://bbs.dezhifl.com/) | Powered by Discuz! X3.4 |