Skip to content

Instantly share code, notes, and snippets.

04cad85cc20d5340da9ba8ef4301f0f57dba0c951d3f7e6bc3e6f59ee03652487b6ddac60083d45b2b774820b6240c0e4cc8ec9e41a9d446dd50d05ef9b6dd7d22;kevinchau
@robertdo
robertdo / hw3.cpp
Last active December 17, 2015 02:39
/*
* File: UniversalHealthCoverage.cpp
* ----------------------
* Name: robertdo
* Section: mmateen
* This file is the starter project for the UniversalHealthCoverage problem
* on Assignment #3.
*/
#include <iostream>
#include <string>
import webapp2
from twilio import twiml
from twilio.rest import TwilioRestClient
class SendSMS(webapp2.RequestHandler):
def get(self):
# replace with your credentials from: https://www.twilio.com/user/account
account_sid = "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
auth_token = "xxxxxxxxxxxxxxxxxxxxxxxxxx"
client = TwilioRestClient(account_sid, auth_token)
# Import the webapp2 framework, the Mail API, and Twilio Rest Client
import webapp2
from google.appengine.api import mail
from twilio.rest import TwilioRestClient
account = "ACXXXXXXXXXXXXXXXXX"
token = "YYYYYYYYYYYYYYYYYY"
client = TwilioRestClient(account, token)
# This is the handler that gets called when your app is visited
class SendEmail(webapp2.RequestHandler):
def get(self):
...
message.send()
# Send the SMS confirmation
# Get the number of the SMS sender
sms_sender = self.request.get('From')
sms = client.sms.messages.create(to=sms_sender, from_="+16504253645",
body="Your email has been sent to %s" % recipient)
@robertdo
robertdo / twilio.py
Last active December 12, 2015 07:29
from twilio.rest import TwilioRestClient
account = "ACXXXXXXXXXXXXXXXXX"
token = "YYYYYYYYYYYYYYYYYY"
client = TwilioRestClient(account, token)
# Import the webapp2 framework
import webapp2
from google.appengine.api import mail
# This is the handler that gets called when your app is visited
class SendEmail(webapp2.RequestHandler):
def get(self):
# Get the recipient from the text message.
# The recipient is the body of the text message.
recipient = self.request.get('Body')