---
title: GVoice command line SMS revisited
date: 2011-09-08 09:07
slug: gvoice-command-line-sms-revisited
categories:
- Code
tags:
- googlevoice
- hacks
- ruby
- terminal
---

<img src="/uploads/2011/09/google_voice_128.png" alt="Google Voice icon" height="128" width="128" class="alignright">

Thanks to a [comment from Evaryont](http://brettterpstra.com/sms-from-the-command-line-with-google-voice/#comment-20950) on the original [SMS from the command line with Google Voice](http://brettterpstra.com/sms-from-the-command-line-with-google-voice/) post, a problem that was causing Error 500s in the script has been solved.

<!--more-->

Check the original post for the script, and change the line (around line 90) 

rnrse = newres.match(/'_rnr_se': '([^']+)'/)[1]

to:

rnrse = CGI.escape(newres.match(/'_rnr_se': '([^']+)'/)[1])
	
The CGI escaping should help with the Google's changes to the `_rnr_se` variable. Evaryont also notes that the script works great in Arch Linux with Ruby 1.9.2. For 1.9 compatibility (thanks to David for clarification in the comments below), remove the `-rjcode` from the hashbang on the first line, and add `require 'jcode' if RUBY_VERSION < '1.9'` below. Have fun!

---

Brett is a writer and developer living in Minnesota, USA. You can follow him as ttscoff. This content is supported by readers like you. [More about Brett](https://brettterpstra.com/contact.md), including social links.

Copyright © 2026 Brett Terpstra. All rights reserved.
