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 "How many submissions to pull? (Default: 1)"
|
||||||
echo "///"
|
echo "///"
|
||||||
read rep
|
read rep
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$rep" ]]; then
|
if [[ -n "$rep" ]]; then
|
||||||
|
@ -82,6 +81,11 @@ fi
|
||||||
|
|
||||||
echo "debug: min sub id: $minsubs"
|
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
|
repeat=1
|
||||||
|
|
||||||
while [ $repeat -eq 1 ]
|
while [ $repeat -eq 1 ]
|
||||||
|
@ -95,8 +99,9 @@ do
|
||||||
else
|
else
|
||||||
# curl the url if it's not in the list already
|
# curl the url if it's not in the list already
|
||||||
# see if it errors out for not existing in the database.
|
# 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
|
if grep -q "not in our database" <<< "$result"; then
|
||||||
echo "($i of $rep) $ranid does not exist, logged and re-rolling."
|
echo "($i of $rep) $ranid does not exist, logged and re-rolling."
|
||||||
echo "$ranid" >> already-checked.txt
|
echo "$ranid" >> already-checked.txt
|
||||||
|
@ -110,7 +115,7 @@ do
|
||||||
# Only upticks the counter on a hit.
|
# Only upticks the counter on a hit.
|
||||||
xdg-open https://furaffinity.net/view/$ranid 2> /dev/null
|
xdg-open https://furaffinity.net/view/$ranid 2> /dev/null
|
||||||
echo "$ranid" >> already-checked.txt
|
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}')
|
counts=$(wc already-checked.txt | awk '{print $1}')
|
||||||
|
|
||||||
sleep 0.5 #to avoid site throttling.
|
sleep 0.5 #to avoid site throttling.
|
||||||
|
|
Loading…
Reference in New Issue