Skip to content

Instantly share code, notes, and snippets.

@zhasm
Created April 16, 2011 07:47
Show Gist options
  • Save zhasm/922960 to your computer and use it in GitHub Desktop.
Save zhasm/922960 to your computer and use it in GitHub Desktop.
# 批量删除饭否消息之#bash#脚本。不解释。
# 将其追加到 .bashrc/.bash_profile 文件,
# 修改ID/PASSWORD
# 刷新 profile 文件
# 执行 rmmsg 即可删除所有所有消息。
# Not for FreeBSD.
function rmmsg()
{
id='fanfouname'
password='password'
count='ok'
while true
do
for i in `curl -s http://api.fanfou.com/statuses/user_timeline.json?id="$id" |grep -Poi "(?<=<id>)[\w-]{11}(?=</id>)"`
do
echo $i
count=`curl -s -u "$id:$password" -d "id=$i" "http://api.fanfou.com/statuses/destroy.xml" |grep -Piow "(?<=statuses_count>)\d+"`
sleep 1
echo $count
if [ -z $count ]; then
break
fi
done
if [ "$count" == "ok" ] || [ -z "$count" ] ;then
break
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment