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

Ruby posts

  • By Drew Baumann
    Generating Cooking Recipes with OpenAI's GPT-3 and Ruby Generating Cooking Recipes with OpenAI's GPT-3 and Ruby

    I enjoy cooking. When I decide to make a new recipe I typically go hunting for that perfect variation of a dish. Often this leads to food blogs. One of the things about food blogs that I find interesting is the need for the author to write a lengthy backstory on why a given recipe means so much to them. The enthusiasm for their recipes gave me the inspiration to make parody recipes using that same voice. The twist: let artificial intelligence do the heavy lifting.

    Sloppy Joe Waffles:

    What’s better than a sloppy joe? Sloppy joe waffles! These sloppy joe waffles are so so good! They’re almost like a cross between a sloppy joe and a classic waffle. They’re warm, hearty, and just all around delicious food meets breakfast food.

    I’m a bit obsessed with the idea of breakfast for dinner. I love to make breakfast foods and …

    Read More
  • By Phil Nash
    How to build a one-time passcode protected conference line with Twilio Verify and Ruby How to build a one-time passcode protected conference line with Twilio Verify and Ruby

    We've seen how to build a conference line and then protect it with a static passcode. However, passcodes can be guessed or leaked, especially if they are reused over time. An alternative is to make a list of numbers that are permitted to join the call. But, since spoofing phone numbers is relatively easy, this still may not protect you.

    A one-time passcode (OTP) sent to a caller's phone or email, can verify they are who they say they are and increase the security of your conference line once more.

    In this post we will take the Rails application we previously developed and add a conference line secured in two ways. We will:

    1. Ensure that the caller is a known participant by checking their caller ID against a list of permitted phone numbers
    2. Send them an OTP using Twilio Verify which they then have to enter correctly to ensure …
    Read More
  • By Phil Nash
    Build a passcode protected conference line with Twilio and Ruby Build a passcode protected conference line with Twilio and Ruby

    We've explored building a conference line with Ruby on Rails before, but the result there was a conference call that anyone could join. If you want to keep your calls a little more private you will want to protect your conference lines with a passcode.

    In this post we will take the Rails application we previously developed and add a stage where we ask for a passcode, only allowing callers into the call if they enter it correctly.

    What you'll need

    In order to build this conference application you will need:

    Once you've got all of that, we'll get started.

    Getting up and running …

    Read More
  • By Phil Nash
    How to build a conference line with Twilio and Ruby How to build a conference line with Twilio and Ruby

    When you need to get a bunch of remote people to talk together, a conference call is the simplest way to do so. Everyone dials a number and in seconds they are talking to each other. In this post we'll build a conference line that anyone can join using Twilio and Ruby on Rails.

    What you'll need

    In order to build this conference line you will need:

    With those tools gathered, we can get started.

    Getting started with a Rails application

    For this post we will create a new Rails app. If you want to add this capability to an existing application, you …

    Read More
  • By Phil Nash
    Build a location-aware WhatsApp weather bot with Ruby, Sinatra and Twilio Build a location-aware WhatsApp bot with Ruby, Sinatra and Twilio

    We've seen how to write a text chatbot using the Twilio API for WhatsApp using Ruby, but WhatsApp also supports sending and receiving location data via their API. In this post we are going to see how to build a WhatsApp bot that can receive and respond to location messages.

    We'll build a weather bot so that you can send your location to the bot to get your local weather forecast.

    What you'll need

    To code along with this post and build your own location-aware WhatsApp bot you will need:

    Configure …

    Read More
  • By Phil Nash
    Build a WhatsApp chatbot with Ruby, Sinatra and Twilio Build a WhatsApp chatbot with Ruby, Sinatra and Twilio

    Chatbots are programs that communicate some way with humans. They can be very basic, responding to keywords or phrases, or use something like Twilio Autopilot to take advantage of natural language understanding (NLU) to provide a richer experience and build out more complicated conversations.

    In this tutorial we are going to see how easy it is to get started building chatbots for WhatsApp using the Twilio API for WhatsApp and the Ruby web framework Sinatra. Here's an example of the conversation we're going to build:

    Using the bot inside the WhatsApp application. First we ask for cats and get a cat picture and fact. Then we ask for dogs and get a dog picture and fact. Finally we ask the bot if it can do anything else and it says it only knows about dogs and cats.

    What you'll need

    To build your own WhatsApp bot along with this tutorial, you will need the following:

    Read More
  • By Phil Nash
    Send and track faxes with the Twilio Fax API using Sinatra and Ruby Send and track faxes with the Twilio Fax API using Sinatra and Ruby

    It happened! I've been waiting for the moment I needed to send a fax since Twilio launched the Programmable Fax API back in 2017 and this week it finally happened! I won't go into detail about what I needed to send, but it's safe to say the medical profession could consider their communication choices for the future.

    I could have sent the fax by uploading a PDF to Twilio Assets and using the API explorer, but that wouldn't have been as fun as over-engineering an entire application to send and track the fax to make sure it arrived and be prepared for any future fax situations.

    In this post I'll share how to build an application for sending and tracking faxes, but if you have faxes to send and want to jump straight into using it, you can find all the source code on GitHub.

    Weapons of choice …

    Read More
  • By Phil Nash
    Track email statuses in Ruby on Rails with SendGrid Track email statuses in Ruby on Rails with SendGrid

    When your application sends emails it is useful to know what happens to those emails, like whether it has been delivered or opened. Or, sometimes more importantly, whether it bounced. The Twilio SendGrid email API doesn't just send emails, it can also send you events via webhook that tell you what happened to your emails.

    In this post we'll build a small application using Ruby on Rails to send emails and update their status based on the Twilio SendGrid event webhooks.

    What you'll need

    In order to build this application along with this post, you will need:

    If you have all of that, then you're ready to get building.

    Preparing the example application

    I …

    Read More
  • By Phil Nash
    Serverless Ruby on AWS Lambda with the Jets framework oMX1dI2w2BskhPm3NagdjbXVb0t9ONMEUOR_7ms5C51r_dW_1mNwj0Y7CYGhu6rlqef7HZr_rh659ECtBuVzqJyqEP5UuHfp6y9JGjCs53qLxeSq0hcbwxyZQZxV4L1dHiaMuBY

    When AWS launched Lambda in 2014 there was no love for Ruby. Platforms like Python, Node.js, and Java started the serverless revolution for hosting and running functions in the cloud. At the end of 2018, support for Ruby was finally launched.

    You can build with Ruby on Lambda using raw functions and Serverless Application Model (SAM) templates as described in the getting started guide for Ruby on Lambda, but Ruby is all about developer happiness and when the config file is longer than your program the process could be described as painful. Enter the Jets framework a framework that "leverages the power of Ruby to make serverless joyful for everyone."

    From Rails to Jets

    Jets combines the experience of building a Rails application with the ability to deploy to AWS Lambda and related services, including API Gateway, S3, and DynamoDB. In this post we're going to …

    Read More
  • By Phil Nash
    Send Images and Files via WhatsApp Using Ruby 8kEzE4pzPwWTXwfR8Cf702Bf_WzY45UvAPBbdqohDl1qudH815kSjIhWqqV4hirBR8iPDRw6EzhsyIH7z4QaJuNvWLyjYmFxrkhBzC8vlaZNsN89BoJx7AToabvAl-M_br4nZBo

    With the Twilio API for WhatsApp we can send messages to WhatsApp numbers. Those messages can be plain text or include files like images, audio and even PDFs up to 5MB. Let's see how to do so using Ruby.

    Things you'll need

    If you want to code along with this post, you'll need a few things:

    Got all that? Let's get coding then!

    Create a new directory for your project and use Bundler to initialise a new Gemfile:

    mkdir whatsapp-messages
    cd whatsapp-messages
    bundle init
    

    Open up the new Gemfile and add the tw …

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