Topic: https://brettterpstra.com/2011/09/08/gvoice-command-line-sms-revisited/
hide preview

What's next? verify your email address for reply notifications!

David 12y, 363d ago

ubuntu 11.10 user here. Great script. Had to change the path of the script to "#!/usr/bin/ruby -Ku" and with the fix needed to change the single quotes manually as discussed above. Works well though. I came here because I couldn't get the more functional googlevoice.pl made by "http://www.0xdecafbad.com/2..." to work.

hide preview

What's next? verify your email address for reply notifications!

Austin 13y, 22d ago

I get the same undefined method 'error!' as eric does, however it doesn't send, it works just fine on my Mac OSX 10.6, however, when run on xubuntu 11.04, it gives that error: I am running ruby 1.8.7 on my mac, and 1.9.3p0 on the xubuntu. What does it parse, I would prefer to run this with php, but the php on the original post's site is down. What does this look for on the page?

remark link
hide preview

What's next? verify your email address for reply notifications!

John 13y, 9d ago

With some experience programming myself, I figured out that the authentication process was causing this error, and I realized I put my password in wrong. Commenting out the res.error does nothing because the program still jumps there; it just has nothing to do once it gets there so it continues with the program. In essence, all commenting it out does is remove the error message from the output, but it's still basically there.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

John 13y, 9d ago

Urgh.. sorry about double-posting. After getting through that, I got a 403 Forbidden, so I'm running under the assumption that Google is just being hard to work with. Any ideas?

hide preview

What's next? verify your email address for reply notifications!

eric ahlman 13y, 92d ago

First, thank you for such an elegant solution....I am attempting to run this on a windows box, using the Ruby193 install. It "appears" to work, if I # out this section :

else

# res.error!
end

If I do not # those two lines, I get this error:

sms.rb:102:in '': undefined method 'error!' for nil:NilClass (NoMethodError)

When I do comment out the two lines noted above, the script runs, and returns to the command prompt returning nothing regarding success or failure. I am not a programmer per se, so I am a little lost in the code and hoping someone can help shed some light on this for me.

Has anyone come across this, or been able to get this to work properly with Windows?

Much appreciated, and happy holidays!
Eric

hide preview

What's next? verify your email address for reply notifications!

Eric 13y, 173d ago

Hey there, I'm on OS X 10.7.1 at the moment. I had to install ruby myself, so it's 1.9.2p290. I made the modification in this post, and I get this error:
░ me@computer [~] $ ./gvtext.rb -n +12345678901 -m "test" -u username:password
./gvtext.rb:88:in <main>': undefined method[]' for nil:NilClass (NoMethodError)

remark link
hide preview

What's next? verify your email address for reply notifications!

Brett 13y, 173d ago

After you made your modifications, what is on line 88?

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Eric 13y, 173d ago

I also had added require 'jcode' if RUBY_VERSION < '1.9' for the other fix.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Brett 13y, 173d ago

That means it's not finding _rnr_se in the returned text, which probably means that the authentication process is failing at some point. That would take more debugging than I can offer on this one, but you might start by dissecting the various calls and spitting the results out to console to see if you're getting expected responses.

remark link parent

load more (1 remarks)
hide preview

What's next? verify your email address for reply notifications!

Eric 13y, 173d ago

Hehehe. I copied the fixed line from here. Didn't work, as shown. I ran rdebug with it. Says something about invalid multibyte character. Turns out, the single quotes weren't regular old single quotes, they were smart quotes. "‘" instead of "'". Works now! Thanks.

hide preview

What's next? verify your email address for reply notifications!

Eric 13y, 173d ago

rnrse = CGI.escape(newres.match(/‘_rnr_se’: ‘([^’]+)’/)[1])

hide preview

What's next? verify your email address for reply notifications!

Thomas 13y, 181d ago

This is a great. I was using a gem but it stopped working when this changed happened. Thanks for the post saved me a lot of time.

Is there any way to grab all text messages in my inbox? I would like to be able to send and receive text messages in terminal.

hide preview

What's next? verify your email address for reply notifications!

Evaryont 13y, 193d ago

Happy to help. The gist is awesome. Thanks for doing the work to get it 99% there!

Just need to initiate calls via the command line, and we'd be golden.

hide preview

What's next? verify your email address for reply notifications!

David 13y, 194d ago

Here is gist of the script with both fixes applied: https://gist.github.com/1204446

hide preview

What's next? verify your email address for reply notifications!

David 13y, 194d ago

It was line 88 for me, not line 90. Specifically, the line to be replaced was this one:

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

Also, to get the script working in ruby 1.9, remove -rjcode from the first line and add

require 'jcode' if RUBY_VERSION < '1.9'

on, say, line 8. (For an explanation, see this.]

remark link
hide preview

What's next? verify your email address for reply notifications!

Brett 13y, 194d ago

Thanks for the clarification, added the details to the main post!

hide preview

What's next? verify your email address for reply notifications!