User Tools

Site Tools


blog:send_sms_from_the_command_line_using_skype_and_unix:linux

Send sms from the command line using skype and unix/linux

Install the Skype4Py module

sudo apt-get install python-pip
sudo pip install Skype4Py
sendsms.py
#!/usr/bin/python
# Send sms via Skype
# v1.0 B.Brunner
# Install skype for python:
# > sudo apt-get install skype
# > sudo apt-get install python-pip
# > sudo pip install Skype4Py
 
import Skype4Py
import sys
 
if (len(sys.argv)>2):
    s = Skype4Py.Skype(Transport='x11')
 
    if not s.Client.IsRunning:
            s.Client.Start()
 
    s.Attach()
 
    message = sys.argv[2]
    number = sys.argv[1]
 
    m = s.CreateSms(Skype4Py.smsMessageTypeOutgoing, number)
    m.Body = message
 
    m.Send()
else:
    print "usage: sendsms.py +number \"message\""

~~LINKBACK~~

Discussion

Enter your comment. Wiki syntax is allowed:
   __ __   ____  _   __ __  __   __  ___
  / //_/  / __/ | | / / \ \/ /  /  |/  /
 / ,<    _\ \   | |/ /   \  /  / /|_/ / 
/_/|_|  /___/   |___/    /_/  /_/  /_/
 
blog/send_sms_from_the_command_line_using_skype_and_unix/linux.txt · Last modified: 2012-07-11 06:57 by brb