Finished Walmart script. Agriwebb notes.

This commit is contained in:
Norm Rasmussen
2023-03-30 21:18:23 -04:00
parent c74649e16b
commit 478b21c8ef
3 changed files with 75 additions and 34 deletions

View File

@ -7,13 +7,18 @@
<div class="uk-container uk-container-center">
<div class="uk-padding-horizontal">
<div class="my-course-banner-content">
<h3 class="custom-title"><img src="{{ current_school.logo_url }}" width="130" alt="TALKSPACE FOUNTAIN LOGO" style="width: 20rem; margin-bottom: -3rem;"></h3>
{% assign persongroup = current_person.groups.last.name | split: "-" %}
<p class=""np-resource-title" style="font-size: 1.5rem; font-weight: 600; margin-bottom: -1rem;">Hi {{current_person.first_name}}! &#128075; {{ persongroup | slice: 1 }}</p>
<h3 class="custom-title"><img src="{{ current_school.logo_url }}" width="130" alt="TALKSPACE FOUNTAIN LOGO" style="width: 20rem; margin-bottom: -3rem;"></h3>
{% if current_person.groups.size > 0 %}
{% assign persongroup = current_person.groups.last.name | split: "-" %}
{% endif %}
<p class="np-resource-title" style="font-size: 1.5rem; font-weight: 600; margin-bottom: -1rem;">Hi {{current_person.first_name}}! &#128075; {% if current_person.groups.size > 0 %} {{ persongroup | slice: 1 }} {% endif %}</p>
<div> <p style="font-weight: 500;">Please complete all your 2023 Compliance Courses.</p></div>
</div>
</div>
</div>
<div class="flex-row-button-container">
</div>
<div class="row np-flex-center">
<div class="col-xs-12">

View File

@ -20,3 +20,36 @@ Properties for promotions. Who has or hasn't completed a prior promotion?
This would be for new customers - how can they create promotions for existing customers?
Existing customers are a phase 2 thing.
They want track in Chargbee.
## 03/30/2023
### Languages with David
ASK:
- Trial account to their software for branding purposes
- Branding/Style guide PDF
- Languages
- Badges (done?)
- Leah?
- Instance Division Segmentation
Languages: partnership with a reseller in Brazil. They will be selling Agriwebb in their region.
Cargill team is the partner.
14th April
Marketing & product is being converted/translated
Support materials is on that list. But hasn't been started.
All hosted in Intercom
90% of academy content are videos. but they haven't been translated yet.
Everything embedded from Wistia.
Audio is unchanging, still English
Will be used for internal and external training with Cargill
Since app is in english, they will need to re-shoot videos after app translation
Captions are acceptable for now.
In the future:
- Design refresh
- Content refresh with product updates
- Leveraging API for enrolling ppl in courses based on Agriwebb product dashboard.

View File

@ -2,11 +2,12 @@ import requests
import pandas as pd
import Apikeys
apiKey = Apikeys.walmartprod
course_dict = {}
def get_course():
count = 0
apiKey = Apikeys.walmartprod
courses = []
course_dict = {}
while True:
count += 1
@ -31,40 +32,42 @@ def get_course():
# FIX: After this, something is being overwritten.
cat_id = response["relationships"]["categories"]["data"]
cats = []
# Pseudo-code
if len(cat_id) == 0:
pass
elif len(cat_id) == 1:
get_cat_name(cat_id)
course_dict(update({"categories": cat}))
else:
for item in cat_id:
# make api call
# return the name
update the dictionary
for item in cat_id:
cats = []
categoryid = item["id"]
# TODO: Maybe split the api call to a separate function?
url = f"https://api2.northpass.com/v2/categories/{categoryid}"
headers = {"accept": "application/json", "X-Api-Key": apiKey}
cat_resp = requests.get(url, headers=headers)
cat_data = cat_resp.json()
cat_name = cat_data["data"]["attributes"]["name"]
cats.append(cat_name)
course_dict.update({"categories": cats})
courses.append(course_dict)
get_cat_name(cat_id, course_dict, courses)
if "next" not in nextlink:
break
write_to_csv(courses)
def get_cat_name(cat_id, course_dict, courses):
headers = {"accept": "application/json", "X-Api-Key": apiKey}
cats = []
if len(cat_id) == 0:
pass
elif len(cat_id) == 1:
categoryid = cat_id[0]["id"]
url = f"https://api2.northpass.com/v2/categories/{categoryid}"
cat_resp = requests.get(url, headers=headers)
cat_data = cat_resp.json()
cat_name = cat_data["data"]["attributes"]["name"]
print(cat_name)
cats.append(cat_name)
course_dict.update({"categories": cats})
else:
for item in cat_id:
categoryid = item["id"]
url = f"https://api2.northpass.com/v2/categories/{categoryid}"
cat_resp = requests.get(url, headers=headers)
cat_data = cat_resp.json()
cat_name = cat_data["data"]["attributes"]["name"]
cats.append(cat_name)
course_dict.update({"categories": cats})
def get_cat_name(item):
pass
try:
courses.append(course_dict)
except TypeError as e:
print(f"Error: {e}")
finally:
write_to_csv(courses)
def write_to_csv(courses):