Started walmart category script
This commit is contained in:
@ -7,7 +7,8 @@ import Apikeys
|
||||
def get_course():
|
||||
count = 0
|
||||
apiKey = Apikeys.walmartprod
|
||||
live_courses = []
|
||||
courses = []
|
||||
category_ids = []
|
||||
|
||||
while True:
|
||||
count += 1
|
||||
@ -22,17 +23,26 @@ def get_course():
|
||||
|
||||
for response in data["data"]:
|
||||
status = response["attributes"]["status"]
|
||||
if status == "live":
|
||||
name = response["attributes"]["name"]
|
||||
live_courses.append(name)
|
||||
with open("/Users/normrasmussen/Downloads/courses.txt", "a") as write:
|
||||
write.write("\n")
|
||||
write.write(name)
|
||||
uuid = response["id"]
|
||||
name = response["attributes"]["name"]
|
||||
|
||||
course_url = f"https://walmart.northpass.com/app/courses/{uuid}"
|
||||
cat_id = response["relationships"]["categories"]["data"]
|
||||
for item in cat_id:
|
||||
categoryid = item["id"]
|
||||
print(categoryid)
|
||||
courses.append(name)
|
||||
with open("/Users/normrasmussen/Downloads/courses.csv", "a") as write:
|
||||
write.write("\n")
|
||||
write.write(name+","+status+","+uuid)
|
||||
|
||||
if "next" not in nextlink:
|
||||
break
|
||||
print(live_courses)
|
||||
#print(courses)
|
||||
# https://walmart.northpass.com/app/courses/
|
||||
|
||||
def get_category_name(category_ids):
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
get_course()
|
||||
|
||||
Reference in New Issue
Block a user