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 Jessica Garson
    Generating Music with Sonic Pi and Ruby jBYyTufwkMUFyBD_Ak6pRbLjb8tirVezDiXA0Oa6zS-g0LKMj6caqRLVlEkr4smnPSuq_CwtGhahVUr6B33fyyhIwrOS4v8OL5jAqe96Sbt5GI9sUbCc0I2BlCPInqE2c3fJ6x7O

    Sonic Pi is an Integrated Development Environment (IDE) for writing music in Ruby. I write code with Ruby using the Sonic Pi IDE and sample myself screaming over it with Audacity under the artist name Messica Arson. The sound I create is very much inspired by the strange sounds of noise music combined with my screams I perfected while fronting a punk band.

    In this tutorial we’ll walk through how to create this song together.

    What is Sonic Pi?

    With Sonic Pi we can interact with our computer as if we were using a synthesizer. Under the hood Sonic Pi is a Ruby wrapper for SuperCollider. There are samples and synthesizers loaded in that you can interact with in countless ways. You can also add your own samples as we will be doing in this tutorial.

    Download Sonic Pi before moving on with the rest of the post. If …

    Read More
  • By Yechiel Kalmenson
    Add SMS Notifications to Your Rails App Using Twilio cat-facts-hero

    Anyone living in NYC with a car knows the pain that is Alternate Side Parking rules. There’s the need to always to be conscious of which side of the street your car is parked on, to run out at the most inopportune times to move it to the other side of the street, and occasionally the opportunity to be blocked in by someone double-parking. All of these, and more, are part of what New York drivers have to put up with on a weekly cycle.

    Cat on a car for the cat facts Ruby on Rails app

    To help me deal with it, I created @AlterSideBot, a Twitter Bot that retweets whenever Alternate Side Parking rules are suspended so I know I don’t have to worry on those days.

    The idea hit on and followers kept coming in… but it had its limitations. First of all, most people aren’t glued to their Twitter feeds, and one tweet can easily get lost …

    Read More
  • 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
  • Newer
    Sign up and start building
    Not ready yet? Talk to an expert.