grabMeOne.sh 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. #!/bin/bash
  2. # Copyright © 2021-2024 Jeffrey 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. TEMP=`mktemp`
  17. TEMP1=`mktemp`
  18. # echo $TEMP
  19. grabLaundry.sh | sort | uniq > $TEMP1
  20. cat $TEMP1 | grep -iv 'CST' > $TEMP
  21. WHAT=`pullline.sh $TEMP`
  22. DB=/home/themusicgod1/TDL/urls.db
  23. FEDIDB=/home/themusicgod1/TDL/fedi.db
  24. BASEDIR=/home/themusicgod1
  25. # echo "are we hre"
  26. echo "maximum" `grep -i "maximum" $BASEDIR/tools/grabLaundry.sh | awk -F' ' '{print $8}' | awk -F')' '{print $1}'`
  27. MAXLEVEL=`grep -i "maximum" $BASEDIR/tools/grabLaundry.sh | awk -F' ' '{print $8}' | awk -F')' '{print $1}'`".0"
  28. # MAXLEVEL="156.0"
  29. echo "maxlevel" $MAXLEVEL
  30. echo "what" $WHAT
  31. FEDIYES=`echo $WHAT | grep -i '@.*@.*'`;
  32. # echo $FEDIYES
  33. #echo "fediyes" $FEDIYES;
  34. if [ -z $FEDIYES ]; then
  35. echo "not fedi";
  36. sqlite3 $DB -line "select url, rss, other, id from news where url like \"%"$WHAT"%\"" | grep -i 'url' | awk -F' ' '{print $3}';
  37. SPC=`echo $WHAT | grep -i 'shitposter.world'`;
  38. echo $SPC
  39. if [[ -n $SPC ]]; then
  40. echo "spc";
  41. # echo "WHAT is " $WHAT
  42. # OUT2=`sqlite3 $DB -line "select level from news where url like \"%"$WHAT"%\"" | grep -i 'level'`
  43. # echo "OUT2:" $OUT2
  44. LEVEL=`sqlite3 $DB -line "select level from news where url like \"%"$WHAT"%\"" | grep -i 'level' | awk -F' ' '{print $3}'`
  45. DOMAIN="shitposter.world"
  46. LEVEL2=`sqlite3 $FEDIDB -line "select level from instances where name like \"%"$DOMAIN"%\"" | grep -i 'level' | awk -F' ' '{print $3}'`
  47. #grep -i "shitposter.world" /home/themusicgod1/FediSus.html | head -n 1 | awk -F' ' '{print $2}'`
  48. echo "user Level is" $LEVEL2
  49. echo "LEVEL is " $LEVEL
  50. echo "we are over by:"
  51. echo "("$LEVEL2" - "$LEVEL")/ "$MAXLEVEL
  52. echo "("$LEVEL2" - "$LEVEL")/ "$MAXLEVEL | bc
  53. howFar.sh $WHAT
  54. exit;
  55. fi
  56. exit;
  57. fi
  58. echo "fedi";
  59. DOMAIN2=`echo $WHAT | awk -F'@' '{print $3}'`;
  60. #split off into its own script
  61. $BASEDIR/tools/domain_estimate_bump.sh $DOMAIN2
  62. # LEVEL2=`grep -i $DOMAIN2 /home/themusicgod1/FediSus.html | head -n 1 | awk -F' ' '{print $2}'`
  63. #echo "domain:" $DOMAIN2
  64. #echo "domain:" $LEVEL2
  65. #LEVEL=`sqlite3 $DB -line "select level from news where url like \"%"$WHAT"%\"" | grep -i 'level' | awk -F' ' '{print $3}'`
  66. #echo "level:" $LEVEL
  67. #echo "we are over by:"
  68. #echo "("$LEVEL2" - "$LEVEL")/ "$MAXLEVEL
  69. #echo "("$LEVEL2" - "$LEVEL")/ "$MAXLEVEL | bc
  70. howFar.sh $WHAT
  71. FSEYES=`sqlite3 $DB -line "select url from news where url like \"%"$WHAT"%\"" | grep -i 'freespeechextremist'`;
  72. if [[ -n $FSEYES ]]
  73. then
  74. echo "fse";
  75. WHAT2=`echo $WHAT | awk -F'@' '{print $2"@"$3}'`;
  76. echo "what2" $WHAT2;
  77. torify finger $WHAT2;
  78. echo $?;
  79. else
  80. sqlite3 $DB -line "select url, rss, other, id from news where url like \"%"$WHAT"%\"";
  81. SPC=`sqlite3 /home/themusicgod1/TDL/urls.db -line "select url from news where url like \"%"$WHAT"%\"" | grep -i 'shitposter.world'`;
  82. echo $SPC
  83. if [[ -n $SPC ]]; then
  84. echo "spc";
  85. exit;
  86. fi
  87. POAST=`echo $WHAT | grep -i 'poa.st'`;
  88. if [[ -n $POAST ]]; then
  89. echo "poast";
  90. LEVEL=`sqlite3 $DB -line "select level from news where url like \"%"$WHAT"%\"" | grep -i 'level' | awk -F' ' '{print $3}'`
  91. echo "LEVEL is " $LEVEL
  92. # LEVEL2=`grep -i "poa.st" /home/themusicgod1/FediSus.html | head -n 1 | awk -F' ' '{print $2}'`
  93. DOMAIN="poa.st"
  94. # we're dealing with poast.
  95. # we don't need the %
  96. LEVEL2=`sqlite3 $FEDIDB -line "select level from instances where name = \""$DOMAIN"\"" | grep -i 'level' | awk -F' ' '{print $3}'`
  97. echo "LEVEL2 should be: " $LEVEL2
  98. echo "difference"
  99. echo "(" $LEVEL2" - "$LEVEL".0) / "$MAXLEVEL
  100. echo "(" $LEVEL2" - "$LEVEL".0) / "$MAXLEVEL | bc
  101. fi
  102. POAST=`echo $WHAT | grep -i 'gleasonator'`;
  103. if [[ -n $GLEASONATOR ]]; then
  104. echo "gleasonator";
  105. LEVEL=`sqlite3 $DB -line "select level from news where url like \"%"$WHAT"%\"" | grep -i 'level' | awk -F' ' '{print $3}'`
  106. echo "LEVEL is " $LEVEL
  107. # echo "should be: 382"
  108. # echo "difference"
  109. DOMAIN="gleasonator.com"
  110. LEVEL2=`sqlite3 $FEDIDB -line "select level from instances where name like \"%"$DOMAIN"%\"" | grep -i 'level' | awk -F' ' '{print $3}'`
  111. # LEVEL2=`grep -i "gleasonator" /home/themusicgod1/FediSus.html | head -n 1 | awk -F' ' '{print $2}'`
  112. echo "should be: " $LEVEL2
  113. echo "difference"
  114. echo "(" $LEVEL2" - "$LEVEL".0) / "$MAXLEVEL
  115. echo "(" $LEVEL2" - "$LEVEL".0) / "$MAXLEVEL | bc
  116. #echo "(382.0 - "$LEVEL".0) / "$MAXLEVEL
  117. # echo "(382.0 - "$LEVEL".0) / "$MAXLEVEL | bc
  118. fi
  119. fi
  120. # this should already happen above. its either happening if its fedi or ifts not fedi
  121. # GRAB SNOWFLAKE
  122. #grabSnowflake.sh $WHAT
  123. #echo "snowflake detection:"
  124. #OUT=`sqlite3 $DB -line "select other from news where url like \"%"$WHAT"%\""| awk -F' ' '{print $3}'`;
  125. #echo "other is:" $OUT
  126. #if [[ -z $OUT ]]; then
  127. #echo "blank other";
  128. #ID=`sqlite3 /home/themusicgod1/TDL/urls.db -line "select id from news where url like \"%"$WHAT"%\"" | awk -F' ' '{print $3}'`;
  129. #echo $ID;
  130. #echo $WHAT;
  131. #OTHER1=`sqlite3 $DB -line "select url, rss, other, id from news where url like \"%"$WHAT"%\"" | grep url | awk -F' ' '{print $3}'` ;
  132. #OTHER2=`getSPCURL.sh $OTHER1`
  133. #echo "update news set other = \""$OTHER2"\" where id = "$ID";"
  134. #fi