2023-11-17 17:18:13 -05:00
|
|
|
import Apikeys
|
|
|
|
|
import requests
|
|
|
|
|
|
2024-01-17 16:44:12 -05:00
|
|
|
APIKEY = Apikeys.RENAISSANCE
|
2023-11-17 17:18:13 -05:00
|
|
|
HEADERS = {
|
|
|
|
|
"accept": "application/json",
|
|
|
|
|
"X-Api-Key": APIKEY,
|
|
|
|
|
}
|
2024-01-16 16:36:37 -05:00
|
|
|
"""
|
2024-01-08 16:41:01 -05:00
|
|
|
COURSES = [
|
|
|
|
|
"Build a Product Analytics Dashboard",
|
|
|
|
|
"FullStory 101",
|
|
|
|
|
"FullStory 201",
|
|
|
|
|
"FullStory Quick Wins",
|
|
|
|
|
"Integrations %26 APIs",
|
|
|
|
|
"Page Flows %26 Pages",
|
|
|
|
|
"Private by Default",
|
|
|
|
|
"Privacy in FullStory",
|
|
|
|
|
"Product Analytics in FullStory",
|
|
|
|
|
"Using Page Flow Cards",
|
|
|
|
|
"Using Conversions",
|
|
|
|
|
"Using Dashboards",
|
|
|
|
|
"Using Defined Events",
|
|
|
|
|
"Using Metrics",
|
|
|
|
|
"Using Funnels",
|
|
|
|
|
"Using Segments %26 Funnels Together",
|
|
|
|
|
"FullStory for Marketers",
|
|
|
|
|
"FullStory for Product Managers",
|
|
|
|
|
"FullStory for Customer Support",
|
|
|
|
|
"FullStory for Engineers",
|
|
|
|
|
"FullStory for Account Management",
|
|
|
|
|
"Product Analytics in FullStory",
|
|
|
|
|
]
|
2024-01-16 16:36:37 -05:00
|
|
|
"""
|
2023-11-17 17:18:13 -05:00
|
|
|
|
2024-01-03 16:22:53 -05:00
|
|
|
|
2023-11-17 17:18:13 -05:00
|
|
|
def get_courses():
|
|
|
|
|
"""
|
|
|
|
|
Function to get courses and their IDs
|
|
|
|
|
"""
|
|
|
|
|
count = 0
|
|
|
|
|
list_of_ids = []
|
|
|
|
|
|
2024-01-08 16:41:01 -05:00
|
|
|
while True:
|
|
|
|
|
# for course_name in COURSES:
|
|
|
|
|
count += 1
|
|
|
|
|
# url = f"https://api.northpass.com/v2/courses/?filter[name][eq]={course_name}"
|
|
|
|
|
url = f"https://api.northpass.com/v2/courses/?limit=100&page={count}"
|
2023-11-17 17:18:13 -05:00
|
|
|
response = requests.get(url, headers=HEADERS)
|
|
|
|
|
response = response.json()
|
|
|
|
|
nextlink = response["links"]
|
|
|
|
|
|
|
|
|
|
for item in response["data"]:
|
2024-01-17 16:44:12 -05:00
|
|
|
cname = item['attributes']['name']
|
|
|
|
|
if "[USCS CH MI]" in cname:
|
|
|
|
|
print(cname)
|
|
|
|
|
# print(item["id"])
|
2024-01-16 16:36:37 -05:00
|
|
|
# idict = {item["attributes"]["name"]: item["id"]}
|
2024-01-04 16:51:28 -05:00
|
|
|
# id = item["id"]
|
|
|
|
|
# name = item["attributes"]["name"]
|
2024-01-16 16:36:37 -05:00
|
|
|
# list_of_ids.append(idict)
|
2023-11-17 17:18:13 -05:00
|
|
|
|
|
|
|
|
if "next" not in nextlink:
|
|
|
|
|
break
|
2024-01-05 17:07:59 -05:00
|
|
|
# print(list_of_ids)
|
2024-01-08 16:41:01 -05:00
|
|
|
# print(len(list_of_ids))
|
2023-11-17 17:18:13 -05:00
|
|
|
|
2024-01-03 16:22:53 -05:00
|
|
|
|
2023-11-17 17:18:13 -05:00
|
|
|
if __name__ == "__main__":
|
|
|
|
|
get_courses()
|