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 Phil Nash
    Better passwords in Ruby applications with the Pwned Passwords API

    Here at Twilio we’re fans of using a second factor to protect user accounts, but that doesn’t mean we’ve forgotten the first factor. Encouraging users to pick strong passwords is still the first line of defence for their accounts.

    After spending years collecting lists of passwords from publicly available data breaches at HaveIBeenPwned, Troy Hunt has made available an API to check whether a password has been used before. This post will show you how to encourage your users to use stronger passwords by checking against the pwned passwords API.

    The Pwned Passwords API

    In 2017 NIST (National Institute of Standards and Technology) as part of their digital identity guidelines recommended that user passwords are checked against existing public breaches of data. The idea is that if a password has appeared in a data breach before then it is deemed compromised and should not be …

    Read More
  • By Jonathan Young
    Send SMS Messages from Your Rails 5 Application with Twilio coffee-roast-varietals

    In the burgeoning world of coffee, there are many varietals of coffee roasts from many regions of the world. Your boss has tasked you to create an application for them to Create, Read, Update, and Destroy (CRUD) different coffee roasts. They have also informed you that they want to be notified via SMS every time a new coffee roast is added to their website in order to prevent their competitors from putting in fake coffee roasts.

    Today, we will create a very basic Rails 5 CRUD app entitled “Coffee Roasts” that will notify your boss via SMS whenever a new coffee roast is added to our website using Twilio’s SMS API.

    Initializing Our Rails Project

    First, let’s ensure that you have Ruby, Bundler, and Rails installed in order to set up a new project:

    gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
    curl -sSL https://get.rvm.io …
    Read More
  • By Wesley Handy
    Beat the Rush on Exclusive Twitter Deals with Node.js and Twilio SMS stickers

    I just couldn’t get online fast enough. You may know the feeling: someone or some business you follow posts a sale on Twitter and by the time you get online, you have either missed the tweet or the sale has ended. You could enable SMS notifications and get every tweet texted to you in a timely fashion, but this really doesn’t help as you start to tune out the texts when the volume exceeds several tweets within a short period of time. What if you could make an app that sends you an SMS notification only when the tweet matches a sale you are actually looking for?

    This is where the Twilio SMS API comes to the rescue.

    In my case, I am a big fan of Wes Bos (@wesbos). Wes is a developer who produces quality and fun online courses for learning web development, particularly in a …

    Read More
  • By Phil Nash
    How to receive and respond to text messages in Ruby with Hanami and Twilio

    If you’re building web applications with Ruby then you’re probably using Rails. Hanami is a young competitor focused on providing a full featured, modern web framework for Ruby developers that is fast, secure and flexible.

    Hanami is a new web application framework for the Ruby community. It has been under development since 2014, initially under the name Lotus. Version 1 was released in April 2017 and version 1.1 was just recently released in October.

    As the introduction to the Hanami guide says, “If you’ve ever felt you’re stretching against the ‘Rails way’, you’ll appreciate Hanami.” While this article isn’t a comparison of Hanami and Rails, as we build with Hanami you will see the ways in which they differ and be able to decide which approach you prefer.

    Let’s investigate building a web application with Hanami with a tried and tested Twilio feature, receiving and responding to text …

    Read More
  • By Alessio Fanelli
    Build Your Own Daily Fantasy Football Salary Tracker with Ruby and Twilio MMS Fantasy football with Twilio MMS

    September is here, the NFL has kicked off and the fantasy season is in full swing. Kareem Hunt is a beast, Zeke is gonna serve a 6 week suspension, there’s so much going on! In this post we’ll show you how to build a price tracker for your favorite daily fantasy sports website with Ruby. It will help you stay on top of the competition and receive price alerts as soon as they happen.

    Tech-wise, we will use SQLite, an embedded database, and Sequel, a lightweight database toolkit for Ruby, to store all the data downloaded for easy accessing and querying. We will then setup a recurring task that downloads the CSV every “x” amount of time, like, say, two hours, and compares the entries with the ones received in the previous update. You will then receive a recap of all changes via MMS on your phone which …

    Read More
  • By Phil Nash
    Verify user phone numbers in Ruby on Rails with the Authy Phone Verification API header

    If you ever need to contact your application’s users by phone then it’s good practice to verify that the phone number they enter is in fact theirs. Let’s see how to verify phone numbers in a Rails 5 application using the Authy Phone Verification API.

    What you’ll need

    To code along with this post, you’ll need:

    Getting started

    Create a new Rails application for this project:

    rails new phone_verification
    cd phone_verification

    We need to add a couple of gems that we’ll use in the project, open up the Gemfile and add authy and envyable. Authy is going to be used for the phone verification, envyable to manage environment variables.

    gem 'envyable'
    gem …
    Read More
  • By Dan Theurer
    Next Generation Ruby Helper Library Release ruby blog logo

    Today, we are excited to announce the general availability of our next-generation Ruby helper library.  

    The approach

    The Ruby library offers new functionality and takes advantage of modern language features. We’ve rebuilt it from the ground up based on the developer feedback we received from you.

    This release concludes the effort of updating our existing libraries to make the helper libraries more consistent, enable faster iteration, and improve the libraries by having a shared foundation across languages. The next-generation SDK family includes PHP, Java, .NET/C#, Python and Node.  

    Let’s take a deeper look at the new features of the Ruby library.

    What’s new

    • Accessing resources: The new library makes Twilio API subdomains (Lookups, Conversations, Monitor, etc.) first-class citizens. You can now also pin a specific versions of the API.
    • Listing resources: There are now two ways to get a list of resources—list and …
    Read More
  • By Kyle Kelly-Yahner
    Callio Pipes Phone Calls Into A Slack Channel using Twilio + Ruby callio

    If a phone rings and there’s no one there to answer it, does it make a sound?

    I mean, yes. Obviously. Why are you focusing on the sound issue? You should be asking who called and what they were calling about.

    If you got a Slack notification every time a lead called, you probably wouldn’t miss that call. If that phone call popped into a Slack channel where any one of your co-workers could grab it, you definitely wouldn’t miss that call.

    That was Netguru’s operating assumption when they built Callio, a Twilio-powered app that forwards your inbound calls to a Slack channel. Callio made it far easier for Netguru to track and manage client communications and inbound leads.

    How Lukasz Built Callio from an Idea to a Production App in a Few Days

    Now, Netguru’s team is spreading the wealth and sharing all their code. Head …

    Read More
  • By Kevin Thompson
    Hacking Pixel Art on Twilio’s SIGNAL Conference Video Wall with Ruby and 23,000 Text Messages

    In May, Twilio set up a massive 40-foot video wall for their SIGNAL conference and handed out hackable wireless badges to every attendee. Once you activated your badge by placing it in one of the podiums in front of the display, you could send commands to a short code that would affect your personal block on the video wall.

    As attendees began activating their badges, you could see squares of the display post their “Ahoy, World!” message and identify their location. It didn’t take long for shapes, words, and large patches of color to begin taking shape on the wall. As soon as I saw what was possible, I had to find a way to draw pixel art on the display.

    Sorting Out SMS Short Code Delivery

    Knowing that all I needed to do was send text messages in order to move and colorize squares on the display, and being …

    Read More
  • By Phil Nash
    Validate Ruby objects with Active Model Validations

    In the world of Rails and Active Record, validating data and storing it in a database is easy. If you’d ever built a simple site that stores data in a Google Spreadsheet then you’d quickly learn that users can enter anything (or nothing). In this post we’ll see how to validate input using part of Active Record: ActiveModel::Validations.

    Spreadsheets can be databases too

    In my last post we built a landing page for a new app using Sinatra and Google Spreadsheets as the database. The app needs one improvement though; users can enter any data they want in the form and it will happily submit. We need to guarantee we get some real data if we are going to contact our users when the app launches.

    We should validate our input and ensure that

    • We get at least a name and email address
    • If we get an email …
    Read More
  • Newer
    Sign up and start building
    Not ready yet? Talk to an expert.