#! /usr/bin/env python3

template = """
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer 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" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
 "https://api.github.com/search/repositories?q=zigbee+created:{}&per_page=100&page={}" \
  > github-repos-zigbee-20231219-{}.json
"""

dates = ["<=2018-01-01T00:00:00Z", "2018-01-01..2020-01-01", "2020-01-01..2022-01-01", ">=2022-01-01T00:00:00Z"]

i = 0
for entry in dates:
    for index in range(1, 11):
        print(template.format(entry, str(index), str(i) + "-" + str(index)))
    i+=1
