4

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个留言:

  1. 365hope on 四 27th, 2009 - 08:31

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



    回复:一起进步!

  2. 3m3m on 四 28th, 2009 - 10:36

    恩恩 小有所成… 我顶



    回复:…

  3. 子曰 on 四 28th, 2009 - 11:47

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



    回复:方便点嘛..

  4. Visionaer on 四 28th, 2009 - 15:41

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



    回复:python很强哦~

给我留言:

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word