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
| Verifying I am +robspectre on my passcard. https://onename.com/robspectre |
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 errbot.backends.test import testbot | |
| from errbot import plugin_manager | |
| class TestTwilioLookup(object): | |
| extra_plugin_dir = '.' | |
| def setUp(self): | |
| self.plugin = plugin_manager.get_plugin_obj_by_name('TwilioLookup') |
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 logging | |
| from errbot import BotPlugin | |
| from errbot import botcmd | |
| from twilio.rest.lookups import TwilioLookupsClient | |
| import phonenumbers | |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Response> | |
| <Play method="GET">https://s3.amazonaws.com/respect-our-privacy/message.mp3</Play> | |
| <Dial>+13103015800</Dial> | |
| </Response> |
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 | |
| client = TwilioRestClient() | |
| client.messages.create(from_="+15556667777", to="+15554443333", media_url="http://vignette2.wikia.nocookie.net/mtg/images/5/54/Meglonoth.jpg/revision/latest/scale-to-width/180?cb=20090129165615") |
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 |
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
| #!/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
| 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
| # 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__) |