New script, walmart notes, etc

This commit is contained in:
Norm Rasmussen
2023-01-30 17:27:36 -05:00
parent d2782fe24c
commit ab43ce9d90
13 changed files with 223 additions and 69 deletions

View File

@ -0,0 +1,29 @@
import requests
apiKey = "HWxj6VTNPwbc3WghFTPzr7SjE"
# Wild Health
groupid = "504c4771-223a-447f-9ec6-08e51bc9ca23"
groupurl = f"https://api.northpass.com/v2/groups/{groupid}/memberships"
def getemailsfromGroup(apiKey, groupid, groupurl):
x = 0
emails = []
while True:
x += 1
url = groupurl
headers = {"accept": "application/json", "X-Api-Key": apiKey}
response = requests.get(url, headers=headers)
jsonResponse = response.json()
next = jsonResponse["links"]
for email in jsonResponse["included"][1]["attributes"]["email"]:
emails.append(email)
if "next" not in next:
break
print(emails)
if __name__ == "__main__":
getemailsfromGroup(apiKey, groupid, groupurl)