Build the future of communications.
Start building for free
  • By Greg Baugues
    Five Reasons Why You Might Want to Join Us for SIGNAL hack-lounge.jpg

    If you're a developer who uses Twilio, you've probably seen an email, tweet, or advertisement asking you to come to our SIGNAL conference on October 17th and 18th in San Francisco.

    We know we're asking a lot when we ask you to join us at SIGNAL. We're asking for two days of your time (three if you do SuperClass) and close to a thousand dollars of your cash (less if you use the promocode at the bottom of this post). But we wouldn't ask you to give so much if we weren't confident you'd get even more in return.

    I've had the privilege of attending the last three SIGNALs. As a developer, I wanted to share a few reasons why you, as a developer, might want to join us this year.

    1. You want to learn Twilio from Twilio's developers

    If you're a developer and reading this post, you probably ...

    Read More
  • By Greg Baugues
    Google Spreadsheets and Python python-and-google-sheets

    This post is inspired by Patrick McKenzie’s reminder that sometimes you don’t need a database:

    In this tutorial, we’ll use Anton Burnashev’s excellent gspread Python package to read, write, and delete data from a Google Spreadsheet with just a few lines of code. 

    Google Drive API and Service Accounts

    At the risk of being Captain Obvious, you’re going to need a spreadsheet if you want to follow along with this post. If you don’t have one on hand that’s full of juicy data, might I suggest you make a copy of this spreadsheet with contact information for all United States legislators(Side note: Ian Webster uses this data in conjunction with ...

    Read More
  • By Greg Baugues
    Hojas de Cálculo de Google y Python python-and-google-sheets

    Esta publicación está inspirada en el recordatorio de Patrick McKenzie de que a veces no se necesita una base de datos:


    En este tutorial, vamos a utilizar el excelente paquete gspread de Python de Anton Burnashev para leer, escribir y borrar datos de una hoja de cálculo de Google con sólo unas pocas líneas de código.

    El API de Google Drive y Cuentas de Servicio

    A riesgo de ser el Capitán Obvio, usted va a a necesitar una hoja de cálculo si desea seguir adelante con este post. Si no tiene una a mano que está lleno de buenos datos, le puedo  sugerir que haga una copia de esta hoja de cálculo con información de contacto de todos ...

    Read More
  • By Greg Baugues
    Tesseract.js: How To OCR Remote Images from a URL in Node tesseract-featured-image

    Tesseract.js is a JavaScript OCR library based on the world’s most popular Optical Character Recognition engine. It’s insanely easy to use on both the client-side and on the server with Node.js.

    Server side, Tesseract.js only works with local images. But, with a little help from the request Node package, we can download a remote image from a URL and then OCR it with Tesseract.js. 

    We’ll tackle this in three steps:

    1. Write code to download a remote file with Node
    2. Write code to OCR that local file with Tessearct
    3. Put the two snippets together

    The final product will take just fifteen lines of JavaScript to OCR images from a URL. Sound good? Let’s get started.

    Download a remote file with Node.js

    Request “is designed to be the simplest way possible to make http calls” in Node.js. We’ll use it to ...

    Read More
  • By Greg Baugues
    Fun with Markov Chains, Python, and Twilio SMS sms-python

    One of the many allures of Twitter is that you can tweet at your favorite celebrity and (maybe) get a response. Still though, tweeting isn’t quite as intimate as trading text messages. So we thought it’d be fun to use Markov Chains, Programmable SMS, and Python to create a bot that impersonates your favorite Twitter personality. 

    We could use the code below to create an SMS chat bot that sounds like anyone with a Twitter account. But to show off it’s true potential, we need to someone with a distinct and recognizable tweeting style. Someone with a huge personality. Someone who has the best words.

    Someone like Donald Trump.

    Ever wish that you could debate Trump? Drop him a text at: 847-55-TRUMP (847-558-7867).



    There are three steps to create this bot:

    1. Download the tweets for a given user to create a corpus of text.
    2. Use the corpus ...
    Read More
  • By Greg Baugues
    3 Things You May Not Know About Twilio Programmable SMS guides

    Twilio Quickstarts make it easy to get started with Programmable SMS. But where do you go to learn more after you send and receive your first text messages?

    Twilio Guides are the documentation you need after “Getting Started.” Guides answer common questions and come replete with code snippets in all the most popular languages so that you can build your Twilio app faster.

    Here are three lessons you’ll find in the Programmable SMS guide. We’ll show off the PHP examples here, but the guides offer code snippets in C#, Java, Python, Ruby, and Javascript as well.

    Use cookies to track SMS conversations

    SMS interactions typically span more than one text. Twilio offers an easy way to track SMS conversations without spinning up a datastore.

    When someone texts your Twilio phone number, Twilio makes an HTTP request to your app and expects an HTTP response in return. Much like ...

    Read More
  • By Greg Baugues
    Build a Fantasy Football Hotline with Ruby and Twilio Voice tom-brady-phone

    A phone was once the fastest way for a sports fan to get their news. In the 70s, 80s and 90s a business called Sports Phone served as a fan’s lifeline for up-to-the minute sports reports.

    Grantland recently ran this fascinating piece on the rise and fall of Sports Phone:

    The concept couldn’t be simpler: You call a number and hear a minute-long message with the latest scores and sports news. A half hour later, if you want another update, you call again — and pay another dime.

    By 1979, the service was averaging about 100,000 calls per day… the company could get upward of 300,000 calls on a good college football Saturday or an NFL Sunday…

    Sports Phone enjoyed an impressive run from 1972 to 2000 but was ultimately crushed by cable news and, of course, the Internet. In fact, it took us less than 30 ...

    Read More
  • By Greg Baugues
    A Simple Way to Receive an SMS with Ruby, Sinatra, and Twilio receive-sms-ruby

    Here’s all the code you need to receive an SMS message and to send a reply using Ruby, Sinatra, and Twilio:

    require 'sinatra'
    post '/message' do
      number = params['From']
      body = params['Body']
      content_type 'text/xml'
           Hello #{number}. You said: #{body}

    If you’d like some explanation on how that code works, watch this short video, or just keep reading.

    When someone texts your Twilio number, Twilio makes an HTTP request to your app with details about the SMS passed in the request parameters. In this post, we’ll use Sinatra to handle Twilio’s request, parse the parameters, and to send a response. 

    First we install Sinatra from the console:

    gem install sinatra

    We create a file called app.rb and require Sinatra:

    require 'sinatra'

    Then we create a route called message to accept a POST request.

    post '/message' do
      # rest of ...
    Read More
  • By Greg Baugues
    A Simple Way to Receive an SMS with PHP and Twilio sms-php-feature-image

    In this tutorial we’ll receive and reply to a text message in PHP. If you’re the type who likes to skip to the punchline, create a file named message.php and paste in this code:

    $number = $_POST['From'];
    $body = $_POST['Body'];
    header('Content-Type: text/xml');
            Hello <?php echo $number ?>.
            You said <?php echo $body ?>

    To learn more about how this works, watch this one minute video, or just keep reading.

    Twilio’s HTTP Request

    When someone texts your Twilio number, Twilio makes an HTTP request to your app. Your app parses the request, then sends back an HTTP response with instructions for what Twilio should do next.


    Details about the inbound SMS, such as the body of the message and the number it was sent from, are passed via the request parameters. To receive and ...

    Read More
  • By Greg Baugues
    How to Receive an SMS in Node.js with Twilio and HyperDev receive-sms-featured-image

    When someone texts your Twilio phone number, Twilio makes an HTTP request to your app. Details about the inbound message, such as what it said and the number it was sent from, are passed in the parameters of that request.

    In this post we’ll look at how to receive and parse that request in JavaScript using Node.js and Express. Then we’ll look at how to reply to the inbound SMS with a message of your own.


    Setup your Node.js Server

    For those who like to skip to the punchline, here’s all the JavaScript you’ll need:

    var express = require('express');
    var bodyParser = require('body-parser');
    var app = express();
    app.use(bodyParser.urlencoded({extended: false}));"/message", function (request, response) {
    app.get("/", function (request, response) {
      response.sendFile(__dirname + '/views/index.html');
    var listener = app.listen(process.env ...
    Read More
  • Newer
    Sign up and start building
    Not ready yet? Talk to an expert.