Skip to content

Instantly share code, notes, and snippets.

@tatocaster
Last active April 22, 2016 12:35
Show Gist options
  • Save tatocaster/8278936 to your computer and use it in GitHub Desktop.
Save tatocaster/8278936 to your computer and use it in GitHub Desktop.
Conntect to magtifun, using python and send desired sms
def magti_send_sms(sms, mobile):
cookie_jar = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie_jar))
urllib2.install_opener(opener)
url_1 = 'http://www.magtifun.ge/index.php?page=11&lang=ge'
values = dict(password='password', user='user', act='1')
data = urllib.urlencode(values)
req = urllib2.Request(url_1, data)
rsp = urllib2.urlopen(req)
url_2 = 'http://www.magtifun.ge/scripts/sms_send.php'
values = dict(recipients=mobile, message_body=sms)
data = urllib.urlencode(values)
req = urllib2.Request(url_2,data)
rsp = urllib2.urlopen(req)
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment