usr bin python coding utf-8 import pycurl import StringIO import re cu

 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
#!/usr/bin/python
# -*- coding:utf-8 -*-
import pycurl
import StringIO
import re
curl = pycurl.Curl()
data = StringIO.StringIO()
socks = '94.54.1.74:29040'
ip = socks.split(':')[0]
curl.setopt(pycurl.PROXYTYPE,pycurl.PROXYTYPE_SOCKS5)
curl.setopt(pycurl.PROXY, socks)
curl.setopt(pycurl.URL, 'http://www.cmyip.com/')
curl.setopt(pycurl.WRITEFUNCTION, data.write)
#curl.setopt(pycurl.POSTFIELDS,'status=TEXT')
#curl.setopt(pycurl.GET,1)
curl.perform()
curl.close()
if re.findall( ip, data.getvalue()):
print "%s рабочий как-бе" % socks