~nova/accendo

1ca32f520c5b92b86df68b213e6e257f527df866 — Novalinium 4 years ago 67457cd
Faster max_page calculation
1 files changed, 1 insertions(+), 1 deletions(-)

M main.sh
M main.sh => main.sh +1 -1
@@ 12,7 12,7 @@ else
    echo "Failed!"
    exit 1
fi
MAX_PAGE=$(elinks -dump ${POST_ID}.1.rp | fgrep per_page | cut -d . -f 2 | sort -u | fgrep file | cut -d = -f 2 | cut -d \& -f 1 | sort -n | tail -n 1)
MAX_PAGE=$(fgrep last_page ${POST_ID}.1.rp | perl -pe 's/.+(\d+)\S+;per_page=\d+\S+Last.*/\1/; print; exit')
if (( MAX_PAGE \> 1 )); then
    seq 2 ${MAX_PAGE} > ${POST_ID}.index
    echo "Done!"