#! /Usr/bin/Python
Import pycurl
Import socket
Import time
Def work_socket ():
S = socket. socket (socket. af_inet, socket. sock_stream)
S. setsockopt (socket. sol_socket, socket. so_reuseaddr, 1)
S. BIND ('10. 67.15.96 ', 9999 ))
S. Listen (10)
S. setblocking (0)
S. setTimeout (10)
Conn, ADDR = S. Accept ()
Conn. Send ('10. 67.15.96 ')
If _ name _ = '_ main __':
Common_list = ['10. 67.15.22 ', '10. 67.15.24', '10. 67.15.25 ', '10. 67.15.48']
Bigapp_list = ['10. 67.15.39 ', '10. 67.15.65', '10. 67.15.66 ', '10. 67.15.27']
Ent_list = ['10. 67.15.23 ', '10. 67.15.42', '10. 67.15.43 ', '10. 67.15.67', '10. 67.15.68 ', '10. 67.15.69']
C = pycurl. Curl ()
For IA in scope (100 ):
For I in common_list:
C. setopt (C. httpheader, ["Host: Taobao", "appname: monitorcommon1", "appversion: 3", "apphash: 604", "accesskey: 2ynwm3xxlm", "secretkey: lwz24
Success "," mcip: 1 default; 1 ::; 1 :@ default :;; "," mysqlport: 3307 "," appcookie: AKs = 4j33x1wm2n, 5020k300z0, 5m0lw4l3zl, o4550jjym3, o1n5kwmyx0, 3 ozlxl
O0jy, k40z12j23x, yyl3jxzj3x, kxjyl3llyy, looz04o3my, region, z2wlx21240, region, noyj200ml0; DEBUG = 1 "])
C. setopt (C. url, '% S/monitor.html' % I)
C. Perform ()
For II in bigapp_list:
C. setopt (C. httpheader, ["Host: monitorbigapp1.sinaapp.com", "appname: monitorbigapp1", "appversion: 3", "apphash: 953", "accesskey: 0y34wm3zlz", "secretkey
: Success "," mcip: 1 default; 1 ::; 1 :@ default :;; "," mysqlport: 3307 "," appcookie: AKs = 4j33x1wm2n, 5020k300z0, 5m0lw4l3zl, o4550jjym3, o1n5kwm
Yx0, 3ozlxlo0jy, k40z12j23x, yyl3jxzj3x, large, looz04o3my, large, z2wlx21240, large, noyj200ml0; DEBUG = 1 "])
C. setopt (C. url, '% S/monitor.html' % II)
C. Perform ()
For III in ent_list:
C. setopt (C. httpheader, ["Host: monitorent1.sinaapp.com", "appname: monitorent1", "appversion: 3", "apphash: 156", "accesskey: 3lyw2wky00", "secretkey: l
Success "," mcip: 1 default; 1 ::; 1 :@ default :;; "," mysqlport: 3307 "," appcookie: AKs = 4j33x1wm2n, 5020k300z0, 5m0lw4l3zl, o4550jjym3, o1n5kwmyx0
, 3ozlxlo0jy, k40z12j23x, yyl3jxzj3x, kxjyl3llyy, looz04o3my, role, z2wlx21240, role, noyj200ml0; DEBUG = 1 "])
C. setopt (C. url, '% S/monitor.html' % III)
C. Perform ()
Time. Sleep (5)
This article is from the "batch CT Batch Data Synchronization" blog, please be sure to keep this source http://4249964.blog.51cto.com/4239964/1559298
An example of using pycurl to upload a header