Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now
Build the future of communications.
Start building for free
  • By Greg Baugues
    5 Reasons Why Developers Should Come to SIGNAL 5reasons.jpg

    If you're a developer who uses Twilio, you've probably seen an email, tweet, or advertisement asking you to come to SIGNAL Conference, August 6 & 7 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 money. But we wouldn't ask you to give so much if we weren't confident you'd get even more in return. And, if you scroll to the bottom, there's a code to save 15%.

    I've had the privilege of attending the last four SIGNAL Conferences. 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

    53478458_10156234069377759_8475449489946050560_o.jpg

    If you're a developer and reading this post, you probably have some professional interest in …

    Read More
  • 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 …

    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 Twilio to make it easy for citizens …

    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 los …

    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 open a URL and then pipe the stream to the local …

    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).

    texting-trump

     

    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 to generate …
    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 the …

    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 minutes to create …

    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'
      "<Response>
         <Message>
           Hello #{number}. You said: #{body}
         </Message>
       </Response>"
    end
    

    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 …
    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:

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

    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.

    sms-http-request-cycle

    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. …

    Read More
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.