I use proxy for internet access. I modification login.py some code:
if self.site.hostname() in config.authenticate.keys():
req = urllib2.Request('http://'+self.site.hostname()+pagename,
data)
req.set_proxy('207.142.131.198:80', 'http')
response = urllib2.urlopen(req)
data = response.read()
wikipedia.cj.save(wikipedia.COOKIEFILE)
return "Ok"
else:
conn = httplib.HTTPConnection("207.142.131.198:80")
conn.request("POST",'http://'+self.site.hostname()+pagename,
data, headers)
response = conn.getresponse()
conn.close()
return result:
D:\Python24>python login.py
Checked for running processes. 1 processes currently running, including the
curr
ent process.
Password for user Sz-iwbot on wikipedia:zh:
Logging in to wikipedia:zh as Sz-iwbot
Should be logged in now
But run interwiki.py can't connect wikipedia:
D:\Python24>python interwiki.py 1
Checked for running processes. 1 processes currently running, including the
curr
ent process.
TitleTranslate: 1 was recognized as Number with value 1
Getting 1 pages from wikipedia:zh...
Traceback (most recent call last):
File "D:\Python24\wikipedia.py", line 1367, in run
data = self.getData()
File "D:\Python24\wikipedia.py", line 1530, in getData
conn.endheaders()
File "D:\Python24\lib\httplib.py", line 798, in endheaders
self._send_output()
File "D:\Python24\lib\httplib.py", line 679, in _send_output
self.send(msg)
File "D:\Python24\lib\httplib.py", line 646, in send
self.connect()
File "D:\Python24\lib\httplib.py", line 630, in connect
raise socket.error, msg
error: (10060, 'Operation timed out')
DBG> got network error in GetAll.run. Sleeping for 15 seconds
why?
plese help me!
[[zh:user:shizhao]]