#galx = re.search(r"name=\"GALX\"\s+value=\"(.+)\"", content).group(1)
try:
galx = re.search(r"name=\"GALX\" type=\"hidden\"\n *value=\"(.+)\"", content).group(1)
except:
galx = ''.join(e for e in content if e.isalnum()) # Remove special characters (leaving only letters & numbers)
galx = galx[galx.index("GALX"):] # Grab everything from GALX forward
galx = galx[:galx.index("input")] # Truncate at input (first word after GALX value)
galx = galx[galx.index("value")+5:] # Extract GALX value
nano /mnt/sda1/sms.py
#!/usr/bin/python
from googlevoice import Voice
voice = Voice()
voice.login('mygv@gmail.com','mygvpassword')
voice.send_sms('12125551212', 'this is a test from Yun')
The Twilio approach mentioned by sonnyyu is free for as long as you are on trial period by the way.
(The trial period does not just run out - you have to upgrade if you want to remove "ads", see below.)
A free twilio SMS will look like this when you receive it while on trial.
"Sent from your Twilio trial account - My Message".
When I tried the above install process, configuration, and simple example python script I get the following error:
root@azdserver:~# python sms-googlevoice.py
Traceback (most recent call last):
File "sms-googlevoice.py", line 5, in
voice.login()
File "/usr/lib/python2.7/site-packages/PyGoogleVoice-0.5.2-py2.7.egg/googlevoice/voice.py", line 104, in login
raise LoginError
googlevoice.util.LoginError
root@azdserver:~#
I've copied and pasted it from my script into Google Voice URL specified in LOGIN= variable above and it works fine so the username and password are correct. If anyone has any ideas I would really appreciate it!!
BTW: Previously I had Twilio installed and had that working without any issue but after doing a factory reset on this board I have had problems reinstalling it which is why I am now trying this approach.
BTW: Previously I had Twilio installed and had that working without any issue but after doing a factory reset on this board I have had problems reinstalling it which is why I am now trying this approach.
Depend your Yun/Shield firmware version using different methods to install twilio: