unfollowscript.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. # Copyright 2020 Jeff Cliff
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or (at
  7. # your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful, but
  10. # WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. # General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. # obviously you want to change this
  17. DBDIR=/home/themusicgod1/TDL
  18. RED="\x1343"
  19. USERID=$1
  20. HOW_SLOW_IS_SPC=`grep -i 'HOW_SLOW_IS' ~/tools/deal_with_users.sh | grep -i '=' | awk -F'=' '{print $2}'`
  21. #echo "SPC IS THIS SLOW" $HOW_SLOW_IS_SPC
  22. BROWSER="chromium"
  23. TEMPFILE=`mktemp`
  24. sleep $HOW_SLOW_IS_SPC;
  25. toot unfollow $USERID;
  26. if [ $? == 0 ];
  27. then
  28. #echo "success";
  29. howFar.sh $USERID > $TEMPFILE
  30. cat $TEMPFILE | grep update ;
  31. if [ $? == 0 ];
  32. # we have an existing user
  33. then
  34. cat $TEMPFILE
  35. else
  36. # cat $TEMPFILE
  37. LINEME=`cat $TEMPFILE | grep -i insert | awk -F ',' '{print $1 "," $2 "," 420 "," $4 "," $5 "," $6}'`
  38. echo sqlite3 $DBDIR/urls.db -line "$LINEME"
  39. sqlite3 $DBDIR/urls.db -line "$LINEME"
  40. # $BROWSER "https://soap.shitposter.club/$USERID" &
  41. fi
  42. else
  43. setterm --foreground red
  44. echo "!! failure !!";
  45. echo "!! run this manually !!"
  46. howFar.sh $USERID | grep -i 'insert'
  47. setterm --foreground default
  48. exit 1;
  49. fi