fa.sh - added exported cookie support and title presentation
parent
1efb001cd6
commit
4970cfd415
|
@ -1 +1,2 @@
|
|||
Furaffinity/already-checked.txt
|
||||
Furaffinity/already-checked.txt
|
||||
Furaffinity/cookies.txt
|
||||
|
|
|
@ -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
|
||||
exit
|
||||
|
|
Loading…
Reference in New Issue