コード例 #1
0
ファイル: purchaseHelp.py プロジェクト: f-prime/CalHacks2016
def purchaseHelp(to, resType):
    if resType == "card":
        xml = '<Response><Gather finishOnKey="#" action="http://rosterentryform.zapto.org/purchase?resType={}-exp"><Say>Please enter your credit card number and then press pound.</Say></Gather></Response>'.format(
            to)
        return Response(xml, mimetype='text/xml')
    elif resType == "exp":
        xml = '<Response><Gather finishOnKey="#" action="http://rosterentryform.zapto.org/purchase?resType={}-cvc"><Say>Please enter your credit card experation date and then press pound.</Say></Gather></Response>'.format(
            to)
        return Response(xml, mimetype='text/xml')
    elif resType == "cvc":
        xml = '<Response><Gather finishOnKey="#" action="http://rosterentryform.zapto.org/purchase?resType={}-finish"><Say>Please enter your credit card cvc number and then press pound.</Say></Gather></Response>'.format(
            to)
        return Response(xml, mimetype='text/xml')
    elif resType == "finish":
        # WHAT DO WE DO WHEN THEY FINISH ENTERING EVERYHTING????
        xml = '<Response><Gather><Say>Your flight has been booked. You will receive a text message containing your confirmation code shortly. Thank you.</Say></Gather></Response>'
        for f in db[to]['flightInfo'].split("--"):
            if "Number: {}".format(db[to]["selectedFlight"]) in f:
                break
        print to
        sendText.sendText(
            to,
            "Confirmed Flight Info\n{}\nYour confirmation code is: {}".format(
                f, ''.join([
                    random.choice(string.uppercase + string.digits)
                    for x in range(6)
                ])))
        return Response(xml, mimetype='text/xml')

    return Response("Please specify a response type - card, exp, cvc",
                    mimetype='text/html')
コード例 #2
0
def testTemperature():
    while True:
        if temperatureSensor.isHot():
            if camera.different(average):
                config = configparser.RawConfigParser()
                config.read('phoneConnect/carWatcher.cfg')
                camera.savePicture()
                sendEmail.sendText(config.get("DATA", "EMAILS").split(','))
        time.sleep(tempCheckDelay)
コード例 #3
0
def exits():
    from sendText import sendText, getCredentials, getRecepients

    subject = 'Exits'

    recepients = getRecepients()

    #recepients = ('*****@*****.**')

    body = 'Reminder: Nearest Exit?'

    print(body)

    #print (recepients[0])

    sendText(subject, body, getCredentials(), recepients[0])
コード例 #4
0
ファイル: main.py プロジェクト: Steve-V/sdv-disaster-training
def exits():
    from sendText import sendText, getCredentials, getRecepients
    
    subject = 'Exits'
    
    recepients = getRecepients()
    
    #recepients = ('*****@*****.**')
    
    body = 'Reminder: Nearest Exit?'
    
    print (body)
    
    #print (recepients[0])
    
    sendText(subject,body,getCredentials(),recepients[0])
コード例 #5
0
ファイル: main.py プロジェクト: Steve-V/sdv-disaster-training
def disaster():
    from sendText import sendText, getCredentials, getRecepients
    
    subject = 'SIMULATED Alert'
    
    recepients = getRecepients()
    
    #recepients = ('*****@*****.**')
    
    body = 'SIMULATED alert. Situation: {}. Your status: {}'.format( getDisaster(), getStatus() )
    
    print (body)
    
    #print (recepients[0])
    
    sendText(subject,body,getCredentials(),recepients[0])
コード例 #6
0
ファイル: birthdays.py プロジェクト: Piethegr8/birthdays
def main():
    year = datetime.now().year

    with open("people.csv", "r") as people:
        reader = csv.reader(people, delimiter="\t")
        next(reader)
        for row in reader:
            birthday = date(int(year), int(row[1]), int(row[2]))

            if isBirthday(birthday):
                sT.sendText(f"Today is {row[0]}'s birthday!")
                print(f"Today is {row[0]}'s birthday")
            else:
                print(f"Today is not {row[0]}'s birthday")

    people.close()
コード例 #7
0
def disaster():
    from sendText import sendText, getCredentials, getRecepients

    subject = 'SIMULATED Alert'

    recepients = getRecepients()

    #recepients = ('*****@*****.**')

    body = 'SIMULATED alert. Situation: {}. Your status: {}'.format(
        getDisaster(), getStatus())

    print(body)

    #print (recepients[0])

    sendText(subject, body, getCredentials(), recepients[0])
コード例 #8
0
	t = random.choice(list(e.profitable))['item_id']
	AllNewsInfo.append(list(extractAllPageInfo(t).keys()))

	for val in e.profitable:
		try:
			tInfo = extractAllPageInfo(val['item_id'])
			if tInfo != None:
				tInfo['profit'] = round(float(val['trade_in_price']), 2) - round(float(val['purchase_price']), 2)
				AllNewsInfo.append(list(tInfo.values()))
				print("appended")
		except Exception as exp:
			print(exp)

	# write the price quotes to csv
	with open('info.csv', 'wb') as myfile:
		wr = csv.writer(myfile, quoting=csv.QUOTE_ALL)
		wr.writerows(AllNewsInfo)

	timeSeconds = round(float(time.clock() - start_time), 2)
	subject = "{} Profitable Items found in {} Seconds".format(len(AllNewsInfo), timeSeconds)
	try:
		import sendText
		sendText.sendText(subject)
		import sendEmail
		sendEmail.sendToMe(subject)
	except:
		try:
			sendText.sendText("Error on Send Email")
		except:
			pass
コード例 #9
0
ファイル: fastGrow.py プロジェクト: tebriz159/Nightchord
            db.update()
            # Updates the current database
            followCount = int(random.randint(1, 4))
            unfollowCount = int(random.randint(1, 4))
            for val in db.grabAllFollowings()[:unfollowCount]:
                tDict.append({"Type": "Unfollow", "User": val['id']})
            updateToFollow(followCount)
            for val in toFollow:
                tDict.append({"Type": "Follow", "User": val})
            random.shuffle(tDict)
            for val in tDict:
                f = doAction(val)
                if f == True:
                    followTrueCt += 1
                if f == False:
                    followFalseCt += 1
                if f == 0:
                    errorCt += 1
                if f == 1:
                    unfollowCt += 1
            db.update()
            try:
                import sendText
                sendText.sendText(
                    "Soundcloud Update: {} Follows ({} Failed) | {} Unfollows | {} Errors"
                    .format(followTrueCt, followFalseCt, unfollowCt, errorCt))
            except:
                print("Error...")
    else:
        print("Outside of time period")