-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhx.py
66 lines (41 loc) · 1.25 KB
/
hx.py
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import time
import socket
import smtplib #加载smtplib模块
from email.mime.text import MIMEText
from email.utils import formataddr
from datetime import datetime, timedelta
from time import sleep
import threading
xh=1534130121
zwh=102110842488
while 1:
try: #创建socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except:
s.close()
continue
try: #解析地址端口
host = 'mob.huanghuai.edu.cn'
remote_ip= socket.gethostbyname( host )
socket.gethostbyname( host )
print remote_ip
except:
s.close()
time.sleep(0.1)
one=1
continue
try: # 连接服务器
s.connect((remote_ip,80))
except:
s.close()
continue
message ='GET http://mob.huanghuai.edu.cn/huanghuai/libraryAppointmentOrder_appointSeat?cardnum=YKT'+str(xh)+'&seatId='+str(zwh)+' HTTP/1.1\r\ncache: 0\r\nHost: mob.huanghuai.edu.cn\r\n\r\n'
s.sendall(message)
reply= s.recv(2048)
print reply
s.sendall(message)
print reply
break