mccdv/recycle1.sh

19 lines
813 B
Bash
Raw Permalink Normal View History

2022-10-18 08:03:14 +11:00
# A simple automater for filling up AIMI exchange.
# Probably don't need to change much for knitting but I can't be fucked figuring it out now.
2022-10-18 07:54:13 +11:00
source conf.sh
nums=$(curl -H "User-Agent: $UA" https://us-moe-app.amz-aws.jp/recycle/aimi_change_list.php?P=$p | grep -Eo '/ [0-9]<input type="hidden" name="item_id[0-9]" value="[^"]*"' | grep -Eo '[0-9]*')
out=
i=0
while read num; do
if [ $i -eq 0 ]; then stage="=$((num-1))"; fi
if [ $i -eq 1 ]; then stage="-F num$num$stage -F item_id$num="; fi
if [ $i -eq 2 ]; then out="$out $stage$num"; fi
i=$(( (i+1)%3 ))
done <<< "$nums"
curl -H "User-Agent: $UA" https://us-moe-app.amz-aws.jp/recycle/aimi_change_check.php?P=$p $out -F page=0 -F sel_num=6
curl -H "User-Agent: $UA" https://us-moe-app.amz-aws.jp/recycle/aimi_change_conf.php -F P=$p $out -F sel_num=6