取消跟踪所有没有回复你的twitter用户
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了取消跟踪所有没有回复你的twitter用户相关的知识,希望对你有一定的参考价值。
Also posted at http://pastebin.com/9FzakUcd
#! /usr/bin/env bash # unfollow_nofriends.sh # unfollow twitter users not following back to you. # ksaver (at identi.ca), Aug, 2010. # uses friendorfollow.com csv file at: # "http://friendorfollow.com/$USERNAME/results/? # orderby=undefined&type=following&format=csv" # and twitter API at: # "http://api.twitter.com/1/friendships/destroy/$ID.xml" # Requieres: curl, egrep, in order to work properly. # This script has been written to help in some twitter account maintanance, # please do not use it for evil pourposes :-) # Public Domain Code. # Not warranty at all. # Edit this two lines according to your correct twitter account: USERNAME='username123' PASSWORD='password321' TWIT_AUTH="$USERNAME:$PASSWORD" TWIT_API="http://api.twitter.com/1/friendships/destroy" FOF_CSV="http://friendorfollow.com/$USERNAME/results/?orderby=undefined&type=following&format=csv" ERR=0 OK=0 function _curl() { } function get_nofriend_list() { _curl "$FOF_CSV" |cut -d',' -f2 |egrep -e [0-9] } function unfollow_id() { ID="$1" _curl -u "$TWIT_AUTH" -d '' "$TWIT_API/$ID.xml" |grep '<error>' > /dev/null && return 1 || return 0 } function error_msg() { ID="$1" echo "Error unfollowing user with ID: $ID" } function __main__() { ## Getting no-friend list in an Array... NOFRIENDS=( $(get_nofriend_list) ) echo "Unfollowing ${#NOFRIENDS[@]} total users..." for id in ${NOFRIENDS[@]} do unfollow_id $id && let OK=$OK+1 || (error_msg $id && let ERR=$ERR+1) done echo "$OK total no-friend users unfollowed and $ERR errors." } ## Run script if not called by source. if [ "$0" != 'bash' ] then __main__ fi
以上是关于取消跟踪所有没有回复你的twitter用户的主要内容,如果未能解决你的问题,请参考以下文章