deal_with_users.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. BASEDIR=/home/themusicgod1
  3. DBDIR=/home/themusicgod1/TDL
  4. # 0. generate databases.db
  5. # 1.
  6. #sqlite3 database.db -line "select url from statuses;" | grep url | awk -F' ' '{print $3}'| awk -F'/' '{print $2"@" $1}' | sort | uniq > users.txt
  7. # get users script in aspublic
  8. # 2. move users to eva
  9. # 3.
  10. cat users.txt | grep -iv '@.*@.*' > users_malformatted.txt
  11. # 4.
  12. cat users_malformatted.txt | awk -F' ' '{print "@"$1}' >> users2.txt
  13. cat users.txt | grep -i '@.*@.*' >> users2.txt
  14. mv users2.txt users.txt
  15. for x in `cat users.txt`; do howFar.sh $x | grep -i update | grep -iv 'insert' | grep -iv '@'; done;
  16. #these i think can be just dropped in, no harm if they are dupes
  17. echo "done. press enter or something";
  18. read ;
  19. for x in `cat users.txt`; do LINEME=`howFar.sh $x | grep -i insert `; echo $LINEME; sqlite3 ~/TDL/urls.db -line "$LINEME"; done
  20. #what we should do next is do some kind of error checking instead of sleep here - print OK if success
  21. #todo: make this dependent on max value
  22. #or make it 100?
  23. MAXLEVEL=`grep -i "maximum" $BASEDIR/tools/grabLaundry.sh | awk -F' ' '{print $3}' | awk -F')' '{print $1}'`".0"
  24. echo "selecting url from news where level > $MAXLEVEL; ..."
  25. sqlite3 $DBDIR/urls.db -line "select url from news where level > $MAXLEVEL;"
  26. echo "put that into followme.txt"
  27. #we shoudl automate this
  28. # should print out the username of anyone this fails with in a greppable way
  29. # there's an issue in this with spc deal with spc users
  30. echo "when done. press enter or something";
  31. read ;
  32. for x in `cat followme.txt`; do echo $x; toot follow $x; sleep 2; done;
  33. check_for_banned_from_spc.sh
  34. echo "delete from news where level > $MAXLEVEL;"