Small CS Ops script to understand how many hours we have been spending on implementation.

This commit is contained in:
Norm Rasmussen
2023-12-11 16:54:17 -05:00
parent 1d8a2e6f2b
commit b35a650a11
5 changed files with 34 additions and 2 deletions

View File

@ -4,7 +4,7 @@ from pathlib import Path
import Apikeys
import os
basefile = "/Users/normrasmussen/Downloads/TS1099-coursecompletions.csv"
basefile = "/Users/normrasmussen/Downloads/ts-mca.csv"
api_key = Apikeys.TALKSPACE_1099
uuid_url = "https://api.northpass.com/v2/people?filter[email][eq]="
prop_url = "https://api.northpass.com/v2/properties/people/"
@ -26,7 +26,7 @@ def load_file(basefile):
for email in completions.itertuples():
row_num = email[1]
row_dict = {"row_num": row_num}
email = email[4]
email = email[3]
url = uuid_url + f"{email}"
response = requests.get(url, headers=headers)
if response.status_code == 200:
@ -45,6 +45,7 @@ def load_file(basefile):
for info in dict_list:
row = info["row_num"]
pid = info["userid"]
print(f"PID IS {pid}")
completions.loc[completions.index[row], "userid"] = pid
completions = completions[completions["userid"] != "0"]
# completions = completions.iloc[:, 0:]

View File

@ -0,0 +1,4 @@
string = "["33410b8a-246b-4253-9fc0-829d67fb1834", "70b43bcf-3261-49d3-8940-0c14f6445888", "5cfc2cb6-7de1-4b33-b945-65fe72a9ddd9", "3d3de462-e29c-4a89-ae60-3a70ec1643a9","1188e41f-b4ac-4b04-9fe5-1bc87883f58b", "9de55b7b-cb41-408e-a6f5-e28d34e4815c", "09354d84-743b-44ea-a4a5-c24697170036", "8c71009d-3210-4897-92f0-cb44b6025343","6b58f46b-1191-4436-aced-67e8d7515e74", "4ea5234d-70a2-46ed-a9aa-f4bc4dfc0769"]"
response = string.replace('"', "'")
print(response)

View File

@ -0,0 +1 @@
{"scriptId":"10QXSGrp0KFNbW8SrcasrhcW9U4v2SZVWe1fTMqUUxlnz3-FHyrqaK4tQ","rootDir":"/Users/normrasmussen/Documents/Work/Scripts/GAS_GS/Imp_email_numbers"}

View File

@ -0,0 +1,19 @@
function getMail(){
var imp_customers = ['cin7', 'datasnipper', 'sandata', 'wsgc', 'anthology', 'chubb', 'achievece']
for (company of imp_customers) {
var counter = 0
var threads = GmailApp.search("to:"+company+" from:me");
for (var i = 0; i < threads.length; i++) {
var message = threads[i].getMessages();
for (var x = 0; x < message.length; x++) {
var item = message[x].getFrom();
var date = String(message[x].getDate());
if ( item.includes("nrasmussen@gainsight.com") && date.includes("Nov")) {
counter++
}
}
}
Logger.log(company+": "+counter)
}
}

View File

@ -0,0 +1,7 @@
{
"timeZone": "America/New_York",
"dependencies": {
},
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8"
}