Fixed walmart screenshot script. Added some notes. Created recast's script.
This commit is contained in:
@ -7,3 +7,9 @@
|
|||||||
Nata & Ashley - Content Strategy
|
Nata & Ashley - Content Strategy
|
||||||
MVP - 4 courses, ready by Mid-March
|
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.
|
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.
|
* 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.
|
* Kaisa to send what she would like on this page.
|
||||||
|
[](2023-04-04_.md)
|
||||||
Design:
|
Design:
|
||||||
|
|
||||||
* Can we change some elements in the non-Pipedrive academy? They would need more CTAs etc.
|
* 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
|
## 03/28/2023
|
||||||
|
|
||||||
GetVero is the customer emailing platform they currently use. They wanted to do it via Segment.
|
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"
|
wildhealth = "HWxj6VTNPwbc3WghFTPzr7SjE"
|
||||||
normsandbox = "SlpQlju219WnWogn94dQUT6Yt"
|
normsandbox = "SlpQlju219WnWogn94dQUT6Yt"
|
||||||
walmartprod = "6hUfJdAartHTHhHc0WIRZYPWe"
|
walmartprod = "6hUfJdAartHTHhHc0WIRZYPWe"
|
||||||
|
recast = "9LISLpq7Ebqot3Xrggn5twKWZ"
|
||||||
|
mizuno = "stXNF84HWL8aCGeRjHEo2rJ1U"
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@ -2,7 +2,7 @@ import requests
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
import Apikeys
|
import Apikeys
|
||||||
|
|
||||||
csv = "/Users/normrasmussen/Downloads/ts_id_roles.csv"
|
csv = "/Users/normrasmussen/Downloads/Recast-learners.csv"
|
||||||
apiKey = Apikeys.skuid
|
apiKey = Apikeys.skuid
|
||||||
baseUrlemail = "https://api.northpass.com/v2/people?filter[email][eq]="
|
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 requests
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import Apikeys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
basefile = "/Users/normrasmussen/Downloads/mizuno-march-completions.csv"
|
basefile = "/Users/normrasmussen/Downloads/Recast-learners.csv"
|
||||||
api_key = "stXNF84HWL8aCGeRjHEo2rJ1U"
|
api_key = Apikeys.recast
|
||||||
uuid_url = "https://api.northpass.com/v2/people?filter[email][eq]="
|
uuid_url = "https://api.northpass.com/v2/people?filter[email][eq]="
|
||||||
prop_url = "https://api.northpass.com/v2/properties/people/"
|
prop_url = "https://api.northpass.com/v2/properties/people/"
|
||||||
headers = {
|
headers = {
|
||||||
@ -12,45 +13,45 @@ headers = {
|
|||||||
"x-api-key": api_key,
|
"x-api-key": api_key,
|
||||||
"content-type": "application/json",
|
"content-type": "application/json",
|
||||||
}
|
}
|
||||||
drop_rows = []
|
|
||||||
|
|
||||||
def load_file(basefile):
|
def load_file(basefile):
|
||||||
|
dict_list = []
|
||||||
|
row_dict = {}
|
||||||
|
basefile = Path(basefile)
|
||||||
|
completions = pd.read_csv(basefile)
|
||||||
try:
|
try:
|
||||||
if os.path.isfile(basefile):
|
if os.path.isfile(basefile):
|
||||||
basefile = Path(basefile)
|
|
||||||
print(f"File found! Importing {basefile}")
|
print(f"File found! Importing {basefile}")
|
||||||
completions = pd.read_csv(basefile)
|
|
||||||
for email in completions.itertuples():
|
for email in completions.itertuples():
|
||||||
row_num = email[0]
|
row_num = email[0]
|
||||||
|
row_dict = {"row_num":row_num}
|
||||||
email = email[3]
|
email = email[3]
|
||||||
print(email)
|
|
||||||
url = uuid_url + f"{email}"
|
url = uuid_url + f"{email}"
|
||||||
response = requests.get(url, headers=headers)
|
response = requests.get(url, headers=headers)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
print("Fetching person found!")
|
|
||||||
response = response.json()
|
response = response.json()
|
||||||
uuid = response["data"][0]["id"]
|
uuid = response["data"][0]["id"]
|
||||||
url2 = prop_url + f"{uuid}"
|
url2 = prop_url + f"{uuid}"
|
||||||
response = requests.get(url2, headers=headers)
|
response = requests.get(url2, headers=headers)
|
||||||
data = response.json()
|
data = response.json()
|
||||||
pgaid = data["data"]["attributes"]["properties"]["account_number"]
|
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:
|
except KeyError as e:
|
||||||
print(e)
|
print(e)
|
||||||
finally:
|
finally:
|
||||||
pass
|
for info in dict_list:
|
||||||
|
row = info['row_num']
|
||||||
def write_to_csv(pgaid, row_num, completions):
|
pid = info['pgaid']
|
||||||
print(pgaid)
|
completions.loc[completions.index[row], "PGA ID"] = pid
|
||||||
try:
|
completions = completions[completions["PGA ID"] != "0"]
|
||||||
completions.loc[completions.index[row_num], "PGA ID"] = pgaid
|
#completions = completions.iloc[:, 0:]
|
||||||
except (TypeError, KeyError) as e:
|
|
||||||
print(e)
|
|
||||||
finally:
|
|
||||||
pass
|
|
||||||
#completions.drop(completions["PGA ID"] == "0")
|
|
||||||
print("the end?")
|
|
||||||
print(completions)
|
print(completions)
|
||||||
|
completions.to_csv(
|
||||||
|
"/Users/normrasmussen/Downloads/MizunoCompletions_with_PGAIDs.csv",
|
||||||
|
index=False
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@ -3,7 +3,10 @@ const axios = require('axios')
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
const apiKey = "6hUfJdAartHTHhHc0WIRZYPWe"
|
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 groupIds = []
|
||||||
|
|
||||||
const getAllGroups = async (num) => {
|
const getAllGroups = async (num) => {
|
||||||
@ -14,7 +17,7 @@ const getAllGroups = async (num) => {
|
|||||||
|
|
||||||
await axios({
|
await axios({
|
||||||
method: 'get',
|
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: {
|
headers: {
|
||||||
'accept': '*/*',
|
'accept': '*/*',
|
||||||
'x-api-key': apiKey,
|
'x-api-key': apiKey,
|
||||||
@ -26,16 +29,18 @@ const getAllGroups = async (num) => {
|
|||||||
page++;
|
page++;
|
||||||
for (let i = 0; i < res.data.data.length; i++) {
|
for (let i = 0; i < res.data.data.length; i++) {
|
||||||
if (res.data.data[i].attributes.status == "live") {
|
if (res.data.data[i].attributes.status == "live") {
|
||||||
|
console.log(res.data.data[i].attributes.name)
|
||||||
groupIds.push(res.data.data[i].id)
|
groupIds.push(res.data.data[i].id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await getAllGroups(page);
|
//await getAllGroups(page);
|
||||||
} else {
|
} else {
|
||||||
for (let i = 0; i < res.data.data.length; i++) {
|
// for (let i = 0; i < res.data.data.length; i++) {
|
||||||
if (res.data.data[i].attributes.status == "live") {
|
// if (res.data.data[i].attributes.status == "live") {
|
||||||
groupIds.push(res.data.data[i].id)
|
// console.log(res.data.data[i].attributes.name)
|
||||||
}
|
// groupIds.push(res.data.data[i].id)
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
@ -47,12 +52,14 @@ const getAllGroups = async (num) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loopIds(i) {
|
function loopIds(i) {
|
||||||
|
console.log("Loop Ids Function")
|
||||||
var num = 1
|
var num = 1
|
||||||
id = groupIds[i]
|
id = groupIds[i]
|
||||||
courseOverview(id, i, num)
|
courseOverview(id, i, num)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function courseOverview(id, i, num) {
|
async function courseOverview(id, i, num) {
|
||||||
|
console.log("Course Overview Function")
|
||||||
const activity = new Array();
|
const activity = new Array();
|
||||||
const url = "https://walmart.northpass.com/app/courses/";
|
const url = "https://walmart.northpass.com/app/courses/";
|
||||||
const browser = await puppeteer.launch();
|
const browser = await puppeteer.launch();
|
||||||
@ -71,6 +78,7 @@ async function courseOverview(id, i, num) {
|
|||||||
await page.title();
|
await page.title();
|
||||||
const [getXpath] = await page.$x('/html/body/div[1]/div');
|
const [getXpath] = await page.$x('/html/body/div[1]/div');
|
||||||
const resourcetitle = await page.evaluate(name => name.innerText, getXpath);
|
const resourcetitle = await page.evaluate(name => name.innerText, getXpath);
|
||||||
|
console.log(resourcetitle)
|
||||||
const resource = resourcetitle.trim();
|
const resource = resourcetitle.trim();
|
||||||
console.log(resource);
|
console.log(resource);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user