4 Ways to Parse a JSON API with Ruby


The Ruby Toolbox lists no less than 25 HTTP clients. Let’s look at how to retrieve and parse JSON results from a RESTful API using the four most popular Ruby HTTP libraries. The four code snippets below will: Define a URL to be parsed. We’ll use the Spotfiy API because it allows requests without authentication. Make an HTTP GET request to that URL. Parse the JSON result.  Each snippet is… Read More

Call Tracking with Google Analytics Measurement Protocol


“Half the money I spend on advertising is wasted. The trouble is, I don’t know which half.” – John Wanamaker Dear Saul Goodman, Esq., First off, my compliments on your phenomenally effective advertising. I can’t drive down the streets of Albuquerque, sit at a bus stop or watch my favorite shows on AMC without seeing one of your ubiquitous “Better Call Saul” ads. Judging from the,… Read More

How to Protect Your Android Phone From the Stagefright Bug


Earlier this morning, a vulnerability was disclosed for Android phones performing a remote code execution over MMS. Dubbed “Stagefright“, the vulnerability exploits SMS/MMS clients by sending a malformed media file to the user which is automatically downloaded by the default client. If you’re using Google Hangouts as your default SMS client, here’s how to protect your device from Stagefright by disabling automatic downloading of media files sent… Read More

Record Bad Customer Service Calls in 30 Lines of Ruby


tl;dr If you’d like to record a phone call, three-way call 888.909.1024 or +44 203 389 52 12 into the conversation and you’ll get a text with the recording when you hang up.  About this time last year, Ryan Block’s “Comcast Call from Hell” made the social network rounds. It was an infuriating eight minute clip of him trying to cancel his service but getting stonewalled by the customer service rep… Read More

How to build SMS Phone Verification in Rails 4 using AJAX


You’ve undoubtedly done something like this before: That’s the SMS phone verification for AirBnB, which uses Twilio to allow hosts and guests to chat without sharing their actual phone numbers. In this tutorial, we’ll integrate SMS phone verification into a Rails 4 app using AJAX and Twilio. Warning: There are a bunch of great reasons to grab a user’s phone number, but if your end goal is two-factor authentication, you… Read More

Validate Phone Numbers in Ruby using the Lookup API

Twilio Lookup

How do you know if a phone number is valid? Maybe you wrote a regular expression to validate a phone number. But does that regex work for all phone numbers, or just ten digit American phone numbers? Maybe you use Google’s libphonenumber to check if a string could be a valid phone number. But libphonenumber can’t tell you if that number is actually in service. Twilio… Read More

Send SMS And MMS From Your Arduino Yun


The Arduino Yun has built-in WiFi and a second microprocessor which runs Linux. That means that you can write programs in your favorite scripting language and interact with APIs directly from your Arduino. In this tutorial, we’ll learn how to send SMS and MMS from our Arduino Yun using Python and Twilio. By the end we will: Install pip and the Twilio Python helper library on… Read More

Build a Photobooth with an Arduino Yun, a Webcam and Dropbox


The Arduino Yun is an Arduino with built-in WiFi and Linux. With the Yun, not only can you do all the hardware hacking that you’d expect from an Arduino, but you can also connect it to the Internet and run programs in your favorite scripting language. In this tutorial, we’re going to build a proof-of-concept for an Arduino powered photo booth to serve as the foundation… Read More