Last active
April 22, 2016 12:35
-
-
Save tatocaster/8278936 to your computer and use it in GitHub Desktop.
Conntect to magtifun, using python and send desired sms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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