diff --git a/.gitignore b/.gitignore index caed8a0..adfdc37 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -Furaffinity/already-checked.txt \ No newline at end of file +Furaffinity/already-checked.txt +Furaffinity/cookies.txt diff --git a/Furaffinity/fa.sh b/Furaffinity/fa.sh index 06b773b..03644b6 100755 --- a/Furaffinity/fa.sh +++ b/Furaffinity/fa.sh @@ -50,7 +50,6 @@ if [[ -z "$rep" ]]; then echo "How many submissions to pull? (Default: 1)" echo "///" read rep - fi if [[ -n "$rep" ]]; then @@ -82,6 +81,11 @@ fi echo "debug: min sub id: $minsubs" +if [ ! -f ./already-checked.txt ]; then +echo "debug: missing already-checked.txt, touching it now." +touch already-checked.txt +fi + repeat=1 while [ $repeat -eq 1 ] @@ -95,8 +99,9 @@ do else # curl the url if it's not in the list already # see if it errors out for not existing in the database. - result=$(curl -s --stderr - https://www.furaffinity.net/view/$ranid) - + result=$(curl -b "./cookies.txt" -s --stderr - https://www.furaffinity.net/view/$ranid) + header= + title=$(grep -m 1 "title" <<< "$result" | cut -c 12- | rev | cut -c 35- | rev) if grep -q "not in our database" <<< "$result"; then echo "($i of $rep) $ranid does not exist, logged and re-rolling." echo "$ranid" >> already-checked.txt @@ -110,7 +115,7 @@ do # Only upticks the counter on a hit. xdg-open https://furaffinity.net/view/$ranid 2> /dev/null echo "$ranid" >> already-checked.txt - echo "($i of $rep) 🔫 New Submission! $ranid " + echo "($i of $rep) 🔫 New Sub! $ranid -- $title" counts=$(wc already-checked.txt | awk '{print $1}') sleep 0.5 #to avoid site throttling. @@ -127,4 +132,4 @@ done * ) echo "Going for another round!"; i=0;; esac done -exit \ No newline at end of file +exit