FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Python-3/GroupSms_Way2.py at master · damnit1989/Python-3 · GitHub
damnit1989
/
Python-3
Public
forked from
geekcomputers/Python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Python-3
/
GroupSms_Way2.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
47 lines (36 loc) · 1.34 KB
Breadcrumbs
Python-3
/
GroupSms_Way2.py
Copy path
File metadata and controls
47 lines (36 loc) · 1.34 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/python
import
urllib2
import
cookielib
from
getpass
import
getpass
import
sys
username
=
raw_input
(
'Enter mobile number:'
)
passwd
=
getpass
()
message
=
raw_input
(
'Enter Message:'
)
#Fill the list with Recipients
x
=
raw_input
(
'Enter Mobile numbers seperated with comma:'
)
num
=
x
.
split
(
','
)
message
=
"+"
.
join
(
message
.
split
(
' '
))
#Logging into the SMS Site
url
=
'http://site24.way2sms.com/Login1.action?'
data
=
'username='
+
username
+
'&password='
+
passwd
+
'&Submit=Sign+in'
#For Cookies:
cj
=
cookielib
.
CookieJar
()
opener
=
urllib2
.
build_opener
(
urllib2
.
HTTPCookieProcessor
(
cj
))
# Adding Header detail:
opener
.
addheaders
=
[(
'User-Agent'
,
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36'
)]
try
:
usock
=
opener
.
open
(
url
,
data
)
except
IOError
:
print
"Error while logging in."
sys
.
exit
(
1
)
jession_id
=
str
(
cj
).
split
(
'~'
)[
1
].
split
(
' '
)[
0
]
send_sms_url
=
'http://site24.way2sms.com/smstoss.action?'
opener
.
addheaders
=
[(
'Referer'
,
'http://site25.way2sms.com/sendSMS?Token='
+
jession_id
)]
try
:
for
number
in
num
:
send_sms_data
=
'ssaction=ss&Token='
+
jession_id
+
'&mobile='
+
number
+
'&message='
+
message
+
'&msgLen=136'
sms_sent_page
=
opener
.
open
(
send_sms_url
,
send_sms_data
)
except
IOError
:
print
"Error while sending message"
sys
.
exit
(
1
)
print
"SMS has been sent."
Back
|
FazBrowse Home
|
New Git URL