Browse Source

update

master
syui 1 year ago
parent
commit
35ef2409c4
No known key found for this signature in database GPG Key ID: ED2A0F5F1DA25512
  1. 16
      follow.zsh
  2. 30
      scpt/github.zsh

16
follow.zsh

@ -3,10 +3,14 @@
d=${0:a:h}
case $1 in
github|g)
$d/scpt/github.zsh
;;
qiita|q)
$d/scpt/qiita.zsh
;;
github|g)
$d/scpt/github.zsh
;;
qiita|q)
$d/scpt/qiita.zsh
;;
*)
echo ${0} "[g]ithub [-s,-a]"
echo ${0} "[q]iita"
;;
esac

30
scpt/github.zsh

@ -41,12 +41,36 @@ n=`echo "${fwer}\n${fing}"|sed '/^$/d'|sort| uniq -u |wc -l`
t=`echo "${fwer}\n${fing}"|sed '/^$/d'|sort|uniq -u`
echo $n
echo $t
echo ---
case $2 in
-s)
exit
;;
-a)
y="all"
;;
*)
unset y
;;
esac
for ((i=1;i<=$n;i++))
do
user=`echo "$t"|awk "NR==$i"`
echo $user
echo curl -i -X DELETE -H "Authorization: token ${token}" https://api.github.com/users/following/$user
echo "enter"
read
curl -i -sL -X DELETE -H "Authorization: token ${token}" https://api.github.com/user/following/$user
echo https://github.com/$user
if [ "$y" != "all" ];then
echo "[yN]"
read y
fi
case $y in
y|all)
curl -i -sL -X DELETE -H "Authorization: token ${token}" https://api.github.com/user/following/$user
echo unfollow $user
;;
*)
echo no run
;;
esac
done

Loading…
Cancel
Save