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 request = require('request'); | |
| var site_id = 7963; | |
| var grab_post_page = function(page) { | |
| request.get({ | |
| url: 'http://posterous.com/api/2/sites/'+site_id+'/posts/public?page='+page, | |
| headers: { | |
| 'Content-Type': 'application/json' | |
| } | |
| }, function(error, response, body) { |
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 CallHandler(webapp.RequestHandler): | |
| def post(self): | |
| # extract the message and phone | |
| message = self.request.get('Body') | |
| phone = self.request.get('From') | |
| # the first word tells us everything... | |
| first = message.lower().split()[0] | |
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 CronHandler(webapp.RequestHandler): | |
| def get(self,time_slot=""): | |
| logging.debug('running cron for timeslot %s' % time_slot) | |
| if systemIsOn() is False: | |
| logging.error('bailing... the system is turned off') | |
| return | |
| # grab the row of data out of the spreadsheet | |
| results = getResults(time_slot) |
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
| <Response> | |
| <Say> | |
| Press one if you said, I love Fluffernutter Pie. Otherwise, press two. | |
| </Say> | |
| <Gather | |
| action="/verificationHandler" | |
| /> | |
| </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
| POST https://api.twilio.com/2010-04-01/Account/{AccountSid}/Calls/{CallSid} | |
| CurrentURL=http://mydomain.com/interrupthandler |
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" encodeing="UTF-8"?> | |
| <Response> | |
| <Say> | |
| Please wait while we work on your request. | |
| </Say> | |
| <Play loop=100> | |
| http://mydomain.com/coolmusic.mp3 | |
| </Play> | |
| </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
| <?xml version="1.0" encodeing="UTF-8"?> | |
| <Response> | |
| <Say> | |
| What is your favorite kind of pie? | |
| </Say> | |
| <Record | |
| action="/recording" | |
| transcribe="true" | |
| transcribeCallback="/transcribeHandler" | |
| /> |
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 MainHandler(webapp.RequestHandler): | |
| def post(self): | |
| # this handler is intended for admin use only | |
| # only accept calls from my own phone | |
| caller = self.request.get('From') | |
| if caller != '608XXXXXXX': | |
| logging.error('illegal caller %s with message %s' % (caller,self.request.get('Body'))) | |
| return |
NewerOlder