Fixed walmart screenshot script. Added some notes. Created recast's script.
This commit is contained in:
@ -7,3 +7,9 @@
|
||||
Nata & Ashley - Content Strategy
|
||||
MVP - 4 courses, ready by Mid-March
|
||||
No involvement from Norm until the MVP launch in March. Then will review content and strategy and offer advice.
|
||||
|
||||
|
||||
Questions for Wayne:
|
||||
|
||||
* Prereq property use case? Label or should it block someone?
|
||||
* "(undefined)" property, can we update it to "NO MATTR" or "BLANK"
|
||||
|
||||
@ -176,7 +176,7 @@ User Profiles:
|
||||
|
||||
* When you click users, they want something available to users. Wants to know the best way to setup.
|
||||
* Kaisa to send what she would like on this page.
|
||||
|
||||
[](2023-04-04_.md)
|
||||
Design:
|
||||
|
||||
* Can we change some elements in the non-Pipedrive academy? They would need more CTAs etc.
|
||||
@ -191,3 +191,4 @@ Start up weekly meetings with Kaisa for 10am on Tuesday
|
||||
## 03/28/2023
|
||||
|
||||
GetVero is the customer emailing platform they currently use. They wanted to do it via Segment.
|
||||
Custom email domain needs to be setup first. Waiting on Kaisa to "get through security"
|
||||
|
||||
@ -5,3 +5,6 @@ talkspace_core = "2vfHw6ksqGfT1gUhPM8pXx2wW"
|
||||
wildhealth = "HWxj6VTNPwbc3WghFTPzr7SjE"
|
||||
normsandbox = "SlpQlju219WnWogn94dQUT6Yt"
|
||||
walmartprod = "6hUfJdAartHTHhHc0WIRZYPWe"
|
||||
recast = "9LISLpq7Ebqot3Xrggn5twKWZ"
|
||||
mizuno = "stXNF84HWL8aCGeRjHEo2rJ1U"
|
||||
|
||||
|
||||
Binary file not shown.
@ -2,7 +2,7 @@ import requests
|
||||
import pandas as pd
|
||||
import Apikeys
|
||||
|
||||
csv = "/Users/normrasmussen/Downloads/ts_id_roles.csv"
|
||||
csv = "/Users/normrasmussen/Downloads/Recast-learners.csv"
|
||||
apiKey = Apikeys.skuid
|
||||
baseUrlemail = "https://api.northpass.com/v2/people?filter[email][eq]="
|
||||
|
||||
|
||||
55
Scripts/API_Tests/add_prop_csv.py
Normal file
55
Scripts/API_Tests/add_prop_csv.py
Normal file
@ -0,0 +1,55 @@
|
||||
|
||||
import requests
|
||||
import pandas as pd
|
||||
from pathlib import Path
|
||||
import Apikeys
|
||||
import os
|
||||
|
||||
basefile = "/Users/normrasmussen/Downloads/Recast-learners.csv"
|
||||
api_key = Apikeys.recast
|
||||
prop_url = "https://api.northpass.com/v2/properties/people/"
|
||||
headers = {
|
||||
"accept": "*/*",
|
||||
"x-api-key": api_key,
|
||||
"content-type": "application/json",
|
||||
}
|
||||
dict_list = []
|
||||
row_dict = {}
|
||||
|
||||
def load_file(basefile):
|
||||
basefile = Path(basefile)
|
||||
completions = pd.read_csv(basefile)
|
||||
try:
|
||||
if os.path.isfile(basefile):
|
||||
print(f"File found! Importing {basefile}")
|
||||
for uuid in completions.itertuples():
|
||||
row_num = uuid[0]
|
||||
uuid = uuid[2]
|
||||
row_dict = {"row_num":row_num}
|
||||
url = prop_url + f"{uuid}"
|
||||
response = requests.get(url, headers=headers)
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
company = data["data"]["attributes"]["properties"]["company"]
|
||||
row_dict["company"] = company
|
||||
elif response.status_code == 404:
|
||||
row_dict["company"] = "User Not Found"
|
||||
dict_list.append(row_dict)
|
||||
print("No errors! Passing along the dictionary!")
|
||||
except KeyError as e:
|
||||
print(e)
|
||||
finally:
|
||||
for info in dict_list:
|
||||
print(info)
|
||||
row = info['row_num']
|
||||
comp = info['company']
|
||||
completions.loc[completions.index[row], "Company"] = comp
|
||||
print(completions)
|
||||
completions.to_csv(
|
||||
"/Users/normrasmussen/Downloads/Recast_learners_w_Company.csv",
|
||||
index=False
|
||||
)
|
||||
|
||||
if __name__ == "__main__":
|
||||
load_file(basefile)
|
||||
|
||||
54
Scripts/API_Tests/getgroup_fromemail.py
Normal file
54
Scripts/API_Tests/getgroup_fromemail.py
Normal file
@ -0,0 +1,54 @@
|
||||
import requests
|
||||
import pandas as pd
|
||||
from pathlib import Path
|
||||
import os
|
||||
|
||||
basefile = "/Users/normrasmussen/Downloads/MizunoCompletions_with_PGAIDs.csv"
|
||||
api_key = "stXNF84HWL8aCGeRjHEo2rJ1U"
|
||||
uuid_url = "https://api.northpass.com/v2/people?filter[email][eq]="
|
||||
group_url = "https://api.northpass.com/v2/groups/"
|
||||
headers = {
|
||||
"accept": "*/*",
|
||||
"x-api-key": api_key,
|
||||
"content-type": "application/json",
|
||||
}
|
||||
|
||||
def load_file(basefile):
|
||||
row_dict = {}
|
||||
dict_list = []
|
||||
basefile = Path(basefile)
|
||||
completions = pd.read_csv(basefile)
|
||||
try:
|
||||
if os.path.isfile(basefile):
|
||||
print(f"File found! Importing {basefile}")
|
||||
for email in completions.itertuples():
|
||||
row_num = email[0]
|
||||
row_dict = {"row_num": row_num}
|
||||
email = email[3]
|
||||
url = uuid_url + f"{email}"
|
||||
response = requests.get(url, headers=headers)
|
||||
if response.status_code == 200:
|
||||
response = response.json()
|
||||
gid = response["data"][0]["relationships"]["groups"]["data"][0]["id"]
|
||||
url2 = group_url + f"{gid}"
|
||||
response = requests.get(url2, headers=headers)
|
||||
data = response.json()
|
||||
group_name = data["data"]["attributes"]["name"]
|
||||
row_dict["group"] = group_name
|
||||
dict_list.append(row_dict)
|
||||
except TypeError as e:
|
||||
pass
|
||||
finally:
|
||||
for info in dict_list:
|
||||
row = info['row_num']
|
||||
group = info['group']
|
||||
completions.loc[completions.index[row], "Group Name"] = group
|
||||
print(completions)
|
||||
completions.to_csv(
|
||||
"/Users/normrasmussen/Downloads/MizunoCompletions_with_PGAIDs.csv",
|
||||
index=False
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
load_file(basefile)
|
||||
BIN
Scripts/Mizuno/.DS_Store
vendored
Normal file
BIN
Scripts/Mizuno/.DS_Store
vendored
Normal file
Binary file not shown.
@ -1,10 +1,11 @@
|
||||
import requests
|
||||
import pandas as pd
|
||||
from pathlib import Path
|
||||
import Apikeys
|
||||
import os
|
||||
|
||||
basefile = "/Users/normrasmussen/Downloads/mizuno-march-completions.csv"
|
||||
api_key = "stXNF84HWL8aCGeRjHEo2rJ1U"
|
||||
basefile = "/Users/normrasmussen/Downloads/Recast-learners.csv"
|
||||
api_key = Apikeys.recast
|
||||
uuid_url = "https://api.northpass.com/v2/people?filter[email][eq]="
|
||||
prop_url = "https://api.northpass.com/v2/properties/people/"
|
||||
headers = {
|
||||
@ -12,45 +13,45 @@ headers = {
|
||||
"x-api-key": api_key,
|
||||
"content-type": "application/json",
|
||||
}
|
||||
drop_rows = []
|
||||
|
||||
def load_file(basefile):
|
||||
dict_list = []
|
||||
row_dict = {}
|
||||
basefile = Path(basefile)
|
||||
completions = pd.read_csv(basefile)
|
||||
try:
|
||||
if os.path.isfile(basefile):
|
||||
basefile = Path(basefile)
|
||||
print(f"File found! Importing {basefile}")
|
||||
completions = pd.read_csv(basefile)
|
||||
for email in completions.itertuples():
|
||||
row_num = email[0]
|
||||
row_dict = {"row_num":row_num}
|
||||
email = email[3]
|
||||
print(email)
|
||||
url = uuid_url + f"{email}"
|
||||
response = requests.get(url, headers=headers)
|
||||
if response.status_code == 200:
|
||||
print("Fetching person found!")
|
||||
response = response.json()
|
||||
uuid = response["data"][0]["id"]
|
||||
url2 = prop_url + f"{uuid}"
|
||||
response = requests.get(url2, headers=headers)
|
||||
data = response.json()
|
||||
pgaid = data["data"]["attributes"]["properties"]["account_number"]
|
||||
write_to_csv(pgaid, row_num, completions)
|
||||
row_dict["pgaid"] = pgaid
|
||||
dict_list.append(row_dict)
|
||||
print("No errors! Passing along the dictionary!")
|
||||
except KeyError as e:
|
||||
print(e)
|
||||
finally:
|
||||
pass
|
||||
|
||||
def write_to_csv(pgaid, row_num, completions):
|
||||
print(pgaid)
|
||||
try:
|
||||
completions.loc[completions.index[row_num], "PGA ID"] = pgaid
|
||||
except (TypeError, KeyError) as e:
|
||||
print(e)
|
||||
finally:
|
||||
pass
|
||||
#completions.drop(completions["PGA ID"] == "0")
|
||||
print("the end?")
|
||||
for info in dict_list:
|
||||
row = info['row_num']
|
||||
pid = info['pgaid']
|
||||
completions.loc[completions.index[row], "PGA ID"] = pid
|
||||
completions = completions[completions["PGA ID"] != "0"]
|
||||
#completions = completions.iloc[:, 0:]
|
||||
print(completions)
|
||||
completions.to_csv(
|
||||
"/Users/normrasmussen/Downloads/MizunoCompletions_with_PGAIDs.csv",
|
||||
index=False
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@ -3,7 +3,10 @@ const axios = require('axios')
|
||||
const path = require('path')
|
||||
|
||||
const apiKey = "6hUfJdAartHTHhHc0WIRZYPWe"
|
||||
const uid = "/\?uid\=7b84eae4-fb34-4689-9f33-24071c3e5a41";
|
||||
// Spark Production ^
|
||||
// const apiKey = "p5fidpuedHaOlPnd8EcpxzQMG"
|
||||
// Luminate Production ^
|
||||
const uid = "/\?uid\=7beg87y4-fh24-4929-3rt5-24kdn87s5241";
|
||||
const groupIds = []
|
||||
|
||||
const getAllGroups = async (num) => {
|
||||
@ -14,7 +17,7 @@ const getAllGroups = async (num) => {
|
||||
|
||||
await axios({
|
||||
method: 'get',
|
||||
url: `https://api2.northpass.com/v2/courses?page=${page}&limit=100`,
|
||||
url: 'https://api2.northpass.com/v2/courses?page=${page}&limit=200',
|
||||
headers: {
|
||||
'accept': '*/*',
|
||||
'x-api-key': apiKey,
|
||||
@ -26,16 +29,18 @@ const getAllGroups = async (num) => {
|
||||
page++;
|
||||
for (let i = 0; i < res.data.data.length; i++) {
|
||||
if (res.data.data[i].attributes.status == "live") {
|
||||
console.log(res.data.data[i].attributes.name)
|
||||
groupIds.push(res.data.data[i].id)
|
||||
}
|
||||
}
|
||||
await getAllGroups(page);
|
||||
//await getAllGroups(page);
|
||||
} else {
|
||||
for (let i = 0; i < res.data.data.length; i++) {
|
||||
if (res.data.data[i].attributes.status == "live") {
|
||||
groupIds.push(res.data.data[i].id)
|
||||
}
|
||||
}
|
||||
// for (let i = 0; i < res.data.data.length; i++) {
|
||||
// if (res.data.data[i].attributes.status == "live") {
|
||||
// console.log(res.data.data[i].attributes.name)
|
||||
// groupIds.push(res.data.data[i].id)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
@ -47,12 +52,14 @@ const getAllGroups = async (num) => {
|
||||
}
|
||||
|
||||
function loopIds(i) {
|
||||
console.log("Loop Ids Function")
|
||||
var num = 1
|
||||
id = groupIds[i]
|
||||
courseOverview(id, i, num)
|
||||
}
|
||||
|
||||
async function courseOverview(id, i, num) {
|
||||
console.log("Course Overview Function")
|
||||
const activity = new Array();
|
||||
const url = "https://walmart.northpass.com/app/courses/";
|
||||
const browser = await puppeteer.launch();
|
||||
@ -71,6 +78,7 @@ async function courseOverview(id, i, num) {
|
||||
await page.title();
|
||||
const [getXpath] = await page.$x('/html/body/div[1]/div');
|
||||
const resourcetitle = await page.evaluate(name => name.innerText, getXpath);
|
||||
console.log(resourcetitle)
|
||||
const resource = resourcetitle.trim();
|
||||
console.log(resource);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user