shell脚本查询百度收录及alexa排名

shell批量查询网站的排名及收录情况..多个网站依葫芦画瓢就可以,不是什么好东西,自己乱搞一通,为的就是方便.用到的工具有curl跟wget,把路径换成你自己的,就可以用了..

  1. #!/bin/bash
  2. cd /root/get_site_info
  3. $(curl http://alexa.chinaz.com/?domain=baiqiuyi.com -o alexa.temp && cat alexa.temp |iconv -f gb2312 -t utf8|grep 综合排名|sed -e 's/<[^>]*>//g' -e 's/^[ \t]*//g' -e 2d > today.result && rm alexa.temp)
  4. $(wget -q http://www.baidu.com/s?wd=site%3Abaiqiuyi.com -O baiqiuyi.temp)
  5. $(cat baiqiuyi.temp|iconv -f gb2312 -t utf8 -o baiqiuyi.html || rm baiqiuyi.temp)
  6. $(sed -e '/百度一下/!d' -e 's/<[^>]*>//g' -e 's/&nbsp;//g' -e '1,2d' baiqiuyi.html >> today.result && echo $(date) >> today.result && rm baiqiuyi.html)
  7. clear
  8. cat /root/get_site_info/today.result
  9. #wall <<EOF
  10. #search from web are Done!
  11. #EOF

4 Comments

  1. shell编程,还没怎么尝试过,有些朋友还在推荐python,
    代码应该还是比较好玩的吧



    回复:python很强哦~

  2. 呵呵,这工具不错,查询收录真不错~~



    回复:方便点嘛..

  3. 恩恩 小有所成… 我顶



    回复:…

  4. 域名查询,这个很有用啊。
    老大春光明媚啊!
    ^_^



    回复:一起进步!