Tons of Solutions Engineering work done today for the rest of the CS team! Headway, Howard Hanna, Engels, Brighton, etc. Also completed Datasnippers auth flow and worked on Anthology's script. Cloned Anthology's courses (900..) and will clone Full Story on Monday.
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
import pprint
|
||||
import csv
|
||||
import json
|
||||
import requests
|
||||
import Apikeys
|
||||
|
||||
APIKEY = Apikeys.ANTHOLOGY
|
||||
APIKEY = Apikeys.DATASNIPPER
|
||||
groups_dict = {}
|
||||
pp = pprint.PrettyPrinter(indent=4)
|
||||
|
||||
@ -26,18 +27,19 @@ def get_groups(APIKEY):
|
||||
group_id = response["id"]
|
||||
group_name = response["attributes"]["name"]
|
||||
# print(group_name)
|
||||
groups_dict = {
|
||||
group_name : group_id
|
||||
}
|
||||
groups_dict = {group_name: group_id}
|
||||
groups.append(groups_dict)
|
||||
|
||||
if "next" not in nextlink:
|
||||
break
|
||||
|
||||
pp.pprint(groups)
|
||||
print(len(groups))
|
||||
# with open('/Users/normrasmussen/Documents/Work/CustomerNotes/Anthology/antho-groups.json', 'w') as jsn:
|
||||
# json.dump(groups, jsn)
|
||||
with open(
|
||||
"/Users/normrasmussen/Downloads/Datasnipper-Groups.csv", "a+", newline='\n'
|
||||
) as csvfile:
|
||||
for group in groups:
|
||||
for key, value in group.items():
|
||||
csvwriter = csv.writer(csvfile)
|
||||
csvwriter.writerow([key, value])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@ -6,6 +6,30 @@ HEADERS = {
|
||||
"accept": "application/json",
|
||||
"X-Api-Key": APIKEY,
|
||||
}
|
||||
COURSES=[
|
||||
"Build a Product Analytics Dashboard",
|
||||
"FullStory 101",
|
||||
"FullStory 201",
|
||||
"FullStory Quick Wins",
|
||||
"Integration and APIs",
|
||||
"Page Flows & 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 and 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():
|
||||
@ -15,22 +39,25 @@ def get_courses():
|
||||
count = 0
|
||||
list_of_ids = []
|
||||
|
||||
while True:
|
||||
count += 1
|
||||
url = f"https://api.northpass.com/v2/courses/?limit=100&page={count}"
|
||||
# while True:
|
||||
for course_name in COURSES
|
||||
# count += 1
|
||||
url = f"https://api.northpass.com/v2/courses/?limit=100&name={course_name}"
|
||||
# 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"]:
|
||||
idict = { item["attributes"]["name"] : item["id"] }
|
||||
print(item["id"])
|
||||
# idict = { item["attributes"]["name"] : item["id"] }
|
||||
# id = item["id"]
|
||||
# name = item["attributes"]["name"]
|
||||
list_of_ids.append(idict)
|
||||
# list_of_ids.append(idict)
|
||||
|
||||
if "next" not in nextlink:
|
||||
break
|
||||
print(list_of_ids)
|
||||
# print(list_of_ids)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user