Hi,
I'm just getting started with pywikipediabot. I want to test the on my
local mediawiki installation. I created the necessary files as follows
==== user-config.py =====
# -*- coding: utf-8 -*-
family = 'OcomWiki'
mylang = 'en'
usernames['OcomWiki']['en'] = u'OcomBot'
And the corresponding family file:
==== families/OcomWiki_family.py =====
# -*- coding: utf-8 -*-
import config, family, urllib
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'OcomWiki'
self.langs = {
'en': 'localhost'
}
def scriptpath(self, code):
return '/wiki'
def version(self, code):
return '1.15.1'
According to various documentations, this should be enough. But when
invoking
python login.py -v -v
I get the following output:
cbersch@ioip0136:~/Desktop/pywikipedia$ python login.py -v -v
Pywikipediabot [http] trunk/pywikipedia (r7206, 2009/09/03, 16:56:11)
Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26)
[GCC 4.3.2]
WARNING: Using -v -v on login.py might leak private data. When sharing,
please double check your password is not readable and log out your bots
session.
Password for user OcomBot on OcomWiki:en:
Logging in to OcomWiki:en as OcomBot
self.site.postData(/wiki?title=Special:Userlogin&useskin=monobook&action=submit,
lgpassword=XXXXX&wpSkipCookieCheck=1&wpPassword=XXXXX&wpDomain=&wpRemember=1&wpLoginattempt=Aanmelden%20%26%20Inschrijven&wpName=OcomBot)
301/Moved Permanently
Date: Fri, 04 Sep 2009 09:43:48 GMT
Server: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny3 with Suhosin-Patch
Location:
http://localhost/wiki/?title=Special:Userlogin&useskin=monobook&action=subm…
Content-Length: 405
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a
href="http://localhost/wiki/?title=Special:Userlogin&useskin=monobook&act…">here</a>.</p>
<hr>
<address>Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny3 with Suhosin-Patch
Server at localhost Port 80</address>
</body></html>
Login failed. Wrong password or CAPTCHA answer?
My settings in the OcomWiki_family.py do not seem to be used. When I
change 'localhost' to anything else or the return statement of
scriptpath to something weird, the same request is sent to localhost.
Thank you,
Christoph