This file contains 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
def escape_html(text): | |
html_escape_table = { | |
"&": "&", | |
'"': """, | |
"'": "'", | |
">": ">", | |
"<": "<", | |
} | |
return "".join(html_escape_table.get(c,c) for c in text) |
This file contains 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 pykemon | |
name = 'charizard' # Example | |
p = pykemon.get(pokemon=name) | |
# Figure out the number of descriptions we have for this Pokemon | |
des = p.descriptions | |
l = str(len(des)) |
This file contains 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
r = Response() | |
r.message(pokemon_name + ',' + description) |
This file contains 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
def twilio_response(pokemon_name, description, type): | |
if type == 'voice': | |
# Do voice response | |
if type =='message': | |
# do message response |
This file contains 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
<Response> | |
<Enqueue action='action.xml' waitUrl='wait_music.xml'>my_queue</Enqueue> | |
</Response> |
This file contains 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 | |
app = Flask(__name__) | |
if __name__ == "__main__": | |
app.run(debug=True) |
This file contains 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 | |
app = Flask(__name__) | |
@app.route('/error_trigger', methods=['POST']) | |
def error_triggers(): | |
return 'Hello Twilio!' | |
if __name__ == "__main__": | |
app.run(debug=True) |
This file contains 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, request | |
app = Flask(__name__) | |
@app.route('/error_trigger', methods=['POST']) | |
def error_triggers(): | |
error_code = request.values.get('ErrorCode', None) | |
return 'The error is' + error_code | |
if __name__ == "__main__": |
This file contains 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, request | |
app = Flask(__name__) | |
@app.route('/error_trigger', methods=['POST']) | |
def error_triggers(): | |
error_code = request.values.get('ErrorCode', None) | |
description = request.values.get('Description', None) | |
if error_code: | |
msg = 'An error on Twilio occurred! ' + description |
This file contains 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, request | |
app = Flask(__name__) | |
from twilio.rest import TwilioRestClient | |
client = TwilioRestClient() | |
@app.route('/error_trigger', methods=['POST']) | |
def error_triggers(): |
OlderNewer