small changes
This commit is contained in:
BIN
Scripts/.DS_Store
vendored
BIN
Scripts/.DS_Store
vendored
Binary file not shown.
45
Scripts/API_Notes/hubspot_post.py
Normal file
45
Scripts/API_Notes/hubspot_post.py
Normal file
@ -0,0 +1,45 @@
|
||||
# This code sample uses the 'requests' library:
|
||||
# http://docs.python-requests.org
|
||||
import requests
|
||||
from requests.auth import HTTPBasicAuth
|
||||
import json
|
||||
|
||||
url = "https://northpass.atlassian.net/wiki/rest/api/content"
|
||||
|
||||
#auth = HTTPBasicAuth("bnJhc211c3NlbkBub3J0aHBhc3MuY29tOnFmOUlsN1g0d2t0aGdRS0JPSWx5NTczNw==")
|
||||
# Find a page CURL
|
||||
#curl -u admin:admin -X GET "http://localhost:8080/confluence/rest/api/content?title=myPage%20Title&spaceKey=TST&expand=history" | python -mjson.tool
|
||||
|
||||
auth = HTTPBasicAuth("nrasmussen@northpass.com", "qf9Il7X4wkthgQKBOIly5737")
|
||||
|
||||
headers = {
|
||||
"X-Atlassian-Token": "no-check",
|
||||
"Accept": "application/json",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
|
||||
# Example POST request to https://api.hubspot.com/crm/v3/objects/notes
|
||||
payload = json.dumps( {
|
||||
"properties": {
|
||||
"hs_timestamp": "2021-11-12T15:48:22Z",
|
||||
"hs_note_body": "Spoke with decision maker Carla. Attached the proposal and draft of contract.",
|
||||
"hubspot_owner_id": "14240720",
|
||||
"hs_attachment_ids": "24332474034;24332474044"
|
||||
}
|
||||
})
|
||||
|
||||
#To associate a note with other CRM records, such as a contact, make a PUT request to /crm/v3/objects/notes/{noteId}/associations/{toObjectType}/{toObjectId}/{associationType}.
|
||||
|
||||
response = requests.request(
|
||||
"POST",
|
||||
url,
|
||||
data=payload,
|
||||
headers=headers,
|
||||
auth=auth
|
||||
)
|
||||
|
||||
response = json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": "))
|
||||
print(response)
|
||||
#x = response.split()
|
||||
#print(x)
|
||||
|
||||
15
Scripts/TalkspaceUsers/usercomparison.py
Normal file
15
Scripts/TalkspaceUsers/usercomparison.py
Normal file
@ -0,0 +1,15 @@
|
||||
import csv
|
||||
from Levenshtein import distance as lev
|
||||
import sys
|
||||
|
||||
x = lev("nrasmussen", "mrasmussen")
|
||||
print(x)
|
||||
|
||||
#def readSpreadsheet():
|
||||
# with open('talkspace.csv', rb) as csvfile:
|
||||
# for line in csvfile.readlines():
|
||||
# array = line.split(',')
|
||||
# emailcol = array[3]
|
||||
|
||||
#def compareemails():
|
||||
# levenshtein.distance(email1, email2)
|
||||
@ -9,15 +9,11 @@ from datetime import date
|
||||
#rootdir = "/Users/normrasmussen/Documents/Northpass/CustomerNotes/"
|
||||
# This is for testing
|
||||
rootdir = "/Users/normrasmussen/Documents/Northpass/CustomerNotes/"
|
||||
todoDir = "/Users/normrasmussen/Documents/Northpass/"
|
||||
input = sys.argv[1]
|
||||
company = input.split("/")[6]
|
||||
print(company)
|
||||
|
||||
#def parsefromVim(rootdir, input):
|
||||
# path = input.split("/")
|
||||
# company = path[7]
|
||||
# findcompany(rootdir, company)
|
||||
|
||||
def findCompany(rootdir, company):
|
||||
files = os.listdir(rootdir)
|
||||
for fileName in files:
|
||||
@ -48,6 +44,20 @@ def writeTasks(rootdir, company, todos):
|
||||
task = singleTask.rsplit("* [ ] ")[1]
|
||||
taskFile.write("* [ ] (" + company + ") " + "[" + currentDate + "] " + task)
|
||||
|
||||
def deleteCompleted(todoDir):
|
||||
todoList = todoDir + "Todos.md"
|
||||
for line in fileinput.input(todoList, inplace=True):
|
||||
if line.strip().startswith("* [X] "):
|
||||
line = ''
|
||||
sys.stdout.write(line)
|
||||
|
||||
#def deleteCompleted(todoDir):
|
||||
# todoList = todoDir + "Todos.md"
|
||||
# with open(todoList, "r+") as file:
|
||||
# for line in file:
|
||||
# if line.startswith("* [X] "):
|
||||
# print(line)
|
||||
|
||||
def deleteTasks(rootdir, company, tasks):
|
||||
file = rootdir + company
|
||||
for line in fileinput.input(file, inplace=1):
|
||||
@ -57,4 +67,4 @@ def deleteTasks(rootdir, company, tasks):
|
||||
|
||||
if __name__ == "__main__":
|
||||
findTodos(rootdir, company)
|
||||
|
||||
deleteCompleted(todoDir)
|
||||
|
||||
Reference in New Issue
Block a user