用于百度站长中主动推送链接提交
#!/bin/bash
#for baidu curl urls.txt by sevenfal 2016-01-31 15:41
echo "clear urls.txt..."
cd . >urls.txt
echo "download sitemap.txt..."
wget http://www.taobaoliao.cn/sitemap.txt
echo "get url > sitemap..."
for loop in `cat sitemap.txt | grep http://www.taobaoliao.cn/`
do
loop1=`echo ${loop:10} |grep http://www.taobaoliao.cn/`
loop2=${loop1%%<*}
if [ "$loop2" != "" ]
then
echo $loop2 >>urls.txt
fi
done
echo "curl urls.txt..."
curl -H 'Content-Type:text/plain' --data-binary @urls.txt "http://data.zz.baidu.com/urls
?site=www.taobaoliao.cn&token=**********"
返回
{"remain":3783,"success":1217}
| 字段 | 是否必选 | 参数类型 | 说明 |
|---|---|---|---|
| success | 是 | int | 成功推送的url条数 |
| remain | 是 | int | 当天剩余的可推送url条数 |
| not_same_site | 否 | array | 由于不是本站url而未处理的url列表 |
| not_valid | 否 | array | 不合法的url列表 |
© 著作权归作者所有
下一篇: shell(3)-字符处理
文章评论(0)