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
pip install twilio flask |
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
python |
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 twilio.rest import TwilioRestClient |
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 twilio.rest import TwilioRestClient | |
TWILIO_ACCOUNT_SID = 'ACxxxxxxxxxxxxxxxx' | |
TWILIO_AUTH_TOKEN = 'yyyyyyyyyyyyyyyyyyy' | |
client = TwilioRestClient(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN) |
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 twilio.rest import TwilioRestClient | |
TWILIO_ACCOUNT_SID = 'ACxxxxxxxxxxxxxxxx' | |
TWILIO_AUTH_TOKEN = 'yyyyyyyyyyyyyyyyyyy' | |
TWILIO_NUMBER = '+1555667777' | |
MY_NUMBER = '+15558889999' | |
client = TwilioRestClient(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN) | |
client.messages.create(from_=TWILIO_NUMBER, to=MY_NUMBER, |
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 the Flask microframework we installed earlier. | |
from flask import Flask | |
# Import the Twilio Python module we install earlier. | |
from twilio import twiml | |
# Create our application | |
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
var app = require('express')(); | |
var twilio = require('./node_modules/twilio'); | |
var http = require('http').Server(app); | |
var io = require('socket.io')(http); | |
var bodyParser = require('body-parser'); | |
app.get('/', function(req, res){ | |
res.sendfile('index.html'); | |
}); | |
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
#!/bin/sh | |
WORDFILE="/usr/share/dict/words" | |
NUMWORDS=5 | |
#Number of lines in $WORDFILE | |
tL=`awk 'NF!=0 {++c} END {print c}' $WORDFILE` | |
for i in `seq $NUMWORDS` | |
do |
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 | |
from textblob import TextBlob | |
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
import requests | |
import timeit | |
def return_42_after_75_seconds(): | |
try: | |
requests.get('http://localhost:5000/', timeout=75) | |
except: | |
pass | |
return 42 |