Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit fb12f30

Browse files
committed
fixed paging examples, as per pull request #28 & #29
1 parent 152c9a1 commit fb12f30

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

examples/example_paging_thru_zones.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def main():
1212

1313
page_number = 0
1414
while True:
15+
page_number += 1
1516
try:
1617
raw_results = cf.zones.get(params={'per_page':5,'page':page_number})
1718
except CloudFlare.exceptions.CloudFlareAPIError as e:
@@ -34,7 +35,6 @@ def main():
3435

3536
if page_number == total_pages:
3637
break
37-
page_number += 1
3838

3939
if __name__ == '__main__':
4040
main()

examples/example_paging_thru_zones.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ PAGE_NUMBER=0
77

88
while true
99
do
10+
# grab the next page
11+
PAGE_NUMBER=`expr ${PAGE_NUMBER} + 1`
1012
cli4 --raw per_page=5 page=${PAGE_NUMBER} /zones > ${tmp}
1113

1214
domains=`jq -c '.|.result|.[]|.name' < ${tmp} | tr -d '"'`
@@ -25,8 +27,5 @@ do
2527
## last section
2628
break
2729
fi
28-
29-
# grab the next page
30-
PAGE_NUMBER=`expr ${PAGE_NUMBER} + 1`
3130
done
3231

0 commit comments

Comments
 (0)