Lot's of skuid scripts for accredible and question mark. Some template changes for Mizuno & G2.
This commit is contained in:
@ -1,10 +1,14 @@
|
||||
import threading
|
||||
import requests
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
def get_results():
|
||||
threading.Timer(5.0, get_results).start()
|
||||
url = "https://ondemand.questionmark.com/deliveryodata/406287/Results"
|
||||
params = "?$filter=ParticipantName eq tom.leggett%40questionmark.com"
|
||||
params = "?$filter=ParticipantName eq 'norm@northpass.com'"
|
||||
# params = "?$filter=ParticipantName eq 'tom.leggett@questionmark.com'"
|
||||
# params = "?$filter=AssessmentID eq 352630000352630L"
|
||||
# Alexa Test 1 AssesmentID = 0346128000346128
|
||||
url_params = f"{url}{params}"
|
||||
|
||||
headers = {
|
||||
@ -15,8 +19,31 @@ def get_results():
|
||||
|
||||
# response = requests.get(url, headers=headers)
|
||||
response = requests.get(url_params, headers=headers)
|
||||
print(response)
|
||||
print(response.text)
|
||||
data = response.json()
|
||||
data = data["value"]
|
||||
|
||||
now = datetime.now()
|
||||
current_time = now.strftime("%H:%M:%S")
|
||||
|
||||
if data == []:
|
||||
logfile = open("qm-log.txt", "a") # append mode
|
||||
logfile.write(f"No Data - {current_time} \n")
|
||||
logfile.close()
|
||||
else:
|
||||
datalist = []
|
||||
for item in data:
|
||||
email = item["ParticipantName"]
|
||||
passval = item["ScoreBandTitle"]
|
||||
score = item["PercentageScore"]
|
||||
assesmentid = item["AssessmentID"]
|
||||
finished = item["WhenFinished"]
|
||||
|
||||
datalist = [email, assesmentid, score, passval, finished]
|
||||
print(datalist)
|
||||
logfile = open("qm-log.txt", "a") # append mode
|
||||
logfile.write(str(datalist))
|
||||
logfile.write(f" - {current_time} \n")
|
||||
logfile.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user