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.
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?
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.
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
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)
After you made your modifications, what is on line 88?
I also had added require 'jcode' if RUBY_VERSION < '1.9' for the other fix.
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.
load more (1 remarks)
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.]