Chinaunix首页 | 论坛 | 博客
  • 博客访问: 104512
  • 博文数量: 31
  • 博客积分: 2292
  • 博客等级: 大尉
  • 技术积分: 310
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-17 23:41
文章分类

全部博文(31)

文章存档

2011年(2)

2010年(29)

分类: LINUX

2011-04-07 23:53:50

还很简陋
  1. #!/bin/bash
  2. login=username:password
  3. if [ -z "$1" ];then
  4.     echo "try -h ^.^"
  5. fi
  6. if [ "$1" = "-h" ];then
  7.     echo "-h : help"
  8.     echo "-s [n]: show"
  9.     echo "-t : say sth to fanfou"
  10. elif [ "$1" = "-t" ];then
  11.     read -dq -p "Say : " mesg
  12.     #echo $mesg
  13.     curl -u $login -d status="$mesg" http://api.fanfou.com/statuses/update.xml > /dev/null
  14. elif [ "$1" = "-s" ];then
  15.     if [ -n "$2" ];then
  16.         count=$2;
  17.     else
  18.         echo "input the number of messages(default 5): \c"
  19.         read count
  20.         if [ "$count" = "" ];then
  21.             count=5
  22.         fi
  23.     fi
  24.         curl -u $login http://api.fanfou.com/statuses/user_timeline.xml?count=$count |    grep '' | cut -c 18-280|sed -e 's:]]>::g'
  25. elif [ "$1" = "-a" ];then
  26.     read -d q
  27. fi
阅读(1355) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~