TripleSeat templates, along with Futuri (both for header and transcript updates). Create SCORM course node script. Added some todos as well.
This commit is contained in:
@ -9,20 +9,26 @@ pp = pprint.PrettyPrinter(indent=4)
|
||||
|
||||
def getMedia(APIKEY, URL):
|
||||
list_data = []
|
||||
scorm_ids = []
|
||||
headers = {"accept": "application/json", "X-Api-Key": APIKEY}
|
||||
URL = f"{URL}?limit=100"
|
||||
response = requests.get(URL, headers=headers)
|
||||
datas = response.json()
|
||||
# pp.pprint(datas)
|
||||
|
||||
for data in datas["data"]:
|
||||
file_type = data["attributes"]["file_type"]
|
||||
file_name = data["attributes"]["file_name"]
|
||||
created_date = data["attributes"]["created_at"]
|
||||
id_val = data["id"]
|
||||
create_link = data["links"]["create_course_from_file"]
|
||||
if "scorm" in file_type:
|
||||
data_tuple = (id_val, file_type, create_link)
|
||||
list_data.append(data_tuple)
|
||||
pp.pprint(list_data)
|
||||
print(len(list_data))
|
||||
if "2024-03" in created_date:
|
||||
if "scorm" in file_type:
|
||||
data_tuple = (id_val, created_date, file_name)
|
||||
scorm_ids.append(id_val)
|
||||
list_data.append(data_tuple)
|
||||
# pp.pprint(list_data)
|
||||
# print(len(list_data))
|
||||
print(scorm_ids)
|
||||
|
||||
# def toCsv(json):
|
||||
# js = pd.json_normalize(json, "data", ["data"])
|
||||
|
||||
Reference in New Issue
Block a user