Updated cin7 templates while Hubert was out, and downloaded all of Chubb's templates since something needed to be udpated. Ran a script for SPS Commerce to get all the courses.
This commit is contained in:
@ -4,37 +4,11 @@ import pprint
|
||||
import csv
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=4)
|
||||
APIKEY = Apikeys.WALMARTPROD
|
||||
APIKEY = Apikeys.SPS
|
||||
HEADERS = {
|
||||
"accept": "application/json",
|
||||
"X-Api-Key": APIKEY,
|
||||
}
|
||||
"""
|
||||
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",
|
||||
]
|
||||
"""
|
||||
|
||||
|
||||
def get_courses():
|
||||
@ -48,25 +22,28 @@ def get_courses():
|
||||
# for course_name in COURSES:
|
||||
count += 1
|
||||
# url = f"https://api.northpass.com/v2/courses/?filter[name][eq]={course_name}"
|
||||
url = f"https://api2.northpass.com/v2/courses/?limit=100&page={count}"
|
||||
url = f"https://api.northpass.com/v2/courses/?limit=100&page={count}"
|
||||
response = requests.get(url, headers=HEADERS)
|
||||
response = response.json()
|
||||
nextlink = response["links"]
|
||||
|
||||
for item in response["data"]:
|
||||
cname = item['attributes']['name']
|
||||
# print(item["id"])
|
||||
idict = {item["attributes"]["name"]: item["id"]}
|
||||
# id = item["id"]
|
||||
# name = item["attributes"]["name"]
|
||||
list_of_ids.append(idict)
|
||||
status = item ['attributes']['status']
|
||||
if status == 'live':
|
||||
cname = item['attributes']['name']
|
||||
# print(item["id"])
|
||||
idict = {item["attributes"]["name"]: item["id"]}
|
||||
# id = item["id"]
|
||||
# name = item["attributes"]["name"]
|
||||
list_of_ids.append(idict)
|
||||
|
||||
if "next" not in nextlink:
|
||||
break
|
||||
|
||||
pp.pprint(list_of_ids)
|
||||
# print(len(list_of_ids))
|
||||
with open(
|
||||
"/Users/normrasmussen/Downloads/Spark-Courses.csv", "a+", newline='\n'
|
||||
"/Users/normrasmussen/Downloads/SPS-Courses.csv", "a+", newline='\n'
|
||||
) as csvfile:
|
||||
for group in list_of_ids:
|
||||
for key, value in group.items():
|
||||
|
||||
Reference in New Issue
Block a user