Added new previous page browsing.
This commit is contained in:
parent
3bd9eace9b
commit
cb234a12e1
9
pirokit
9
pirokit
@ -28,6 +28,8 @@ esac
|
|||||||
page=1
|
page=1
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
|
||||||
|
# get the page html
|
||||||
curl -s $url/$page/ -o tmp.html
|
curl -s $url/$page/ -o tmp.html
|
||||||
|
|
||||||
#get titles
|
#get titles
|
||||||
@ -45,7 +47,6 @@ while true; do
|
|||||||
awk '{print NR " - "$0""}' titles.bw > titlesNumbered.bw
|
awk '{print NR " - "$0""}' titles.bw > titlesNumbered.bw
|
||||||
|
|
||||||
# prepend next and previous
|
# prepend next and previous
|
||||||
|
|
||||||
[ "$page" == "1" ] && printf '%s\n' "next" >> titlesNumbered.bw || \
|
[ "$page" == "1" ] && printf '%s\n' "next" >> titlesNumbered.bw || \
|
||||||
printf '%s\n%s' "next" "previous" >> titlesNumbered.bw
|
printf '%s\n%s' "next" "previous" >> titlesNumbered.bw
|
||||||
|
|
||||||
@ -53,11 +54,11 @@ while true; do
|
|||||||
LINE=$(paste -d\| titlesNumbered.bw seeders.bw leechers.bw sizes.bw | \
|
LINE=$(paste -d\| titlesNumbered.bw seeders.bw leechers.bw sizes.bw | \
|
||||||
sed 's/|||//' | dmenu -i -l 25 | cut -d- -f1)
|
sed 's/|||//' | dmenu -i -l 25 | cut -d- -f1)
|
||||||
|
|
||||||
[ "$LINE" == "next" ] && let "page+=1"
|
[ "$LINE" == "next" ] && let "page+=1" && continue
|
||||||
|
|
||||||
[ "$LINE" == "previous" ] && let "page-=1"
|
[ "$LINE" == "previous" ] && let "page-=1" && continue
|
||||||
|
|
||||||
[ -z "$LINE" ] && exit
|
[ -z "$LINE" ] && exit || break
|
||||||
done
|
done
|
||||||
|
|
||||||
suburl=$(sed "${LINE}q;d" links.bw)
|
suburl=$(sed "${LINE}q;d" links.bw)
|
||||||
|
Loading…
Reference in New Issue
Block a user