This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
import os | |
app = Flask(__name__) | |
if __name__ == '__main__': | |
port = int(os.environ.get('PORT', 5000)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
import os | |
app = Flask(__name__) | |
reasons = [ | |
'Alex: You hate the Giants.', | |
'Kent: You have a great sense of humor.', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from twilio import twiml | |
import os | |
from random import choice | |
app = Flask(__name__) | |
@app.route('/sms', methods=['POST']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask import request | |
from twilio import twiml | |
import os | |
from random import choice | |
app = Flask(__name__) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask import request | |
import os | |
from random import choice | |
app = Flask(__name__) | |
@app.route('/sms', methods=['POST']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('Services/Twilio.php'); | |
require_once('auth.php'); | |
$client = new Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN); | |
echo "Old list: \n"; | |
foreach ($client->account->recordings as $rec) { | |
print $rec->sid."\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Human(object): | |
def eat(self, food): | |
pieces = food.split() | |
if pieces: | |
pieces.pop() | |
return ''.join([piece.replace(piece, "poop ") for piece in | |
pieces]).strip() | |
katsuro = Human() | |
lindsay = Human() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flask | |
from twilio import twiml | |
from twilio.rest import TwilioRestClient | |
from twilio.util import TwilioCapability | |
import os | |
app = flask.Flask(__name__) | |
@app.route('/conference', methods=['POST']) | |
def conference(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/voice', methods=['POST']) | |
def voice(): | |
response = twiml.Response() | |
response.record(action="/recordingHandler") | |
return str(response) | |
@app.route('/recordingHandler', methods=['POST']) | |
def recordingHandler(): | |
recording_url = request.form['RecordingUrl'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/voice', methods=['POST']) | |
def voice(): | |
response = twiml.Response() | |
response.say("Leave a message.") | |
response.record(action="recordHandler", finishOnKey="#", maxLength="20") | |
return str(response) |