Manual talk:Pywikipediabot
- [History↑]
Contents
| Thread title | Replies | Last modified |
|---|---|---|
| NameError: global name 'appendtops' is not defined | 2 | 09:02, 22 May 2013 |
| Bot not work on min Wikipedia | 1 | 19:32, 2 May 2013 |
| createitem in rewrite branch | 1 | 20:44, 30 April 2013 |
| Some bugs | 4 | 22:01, 25 March 2013 |
| Versions on other wikis? | 0 | 04:47, 9 March 2013 |
| Text after reflinks | 2 | 15:07, 20 January 2013 |
| Must use Monobook to run Pywikipediabot? | 1 | 11:58, 19 January 2013 |
| API Issues... | 0 | 08:16, 27 June 2012 |
Hi,
I got an issue on pywikipediabot today when I was using pagefromfile.py script to generate pages to my SMW box from template files. Please see below:
mediawiki@ontodiaAZ:~/core/pywikipedia$ python pagefromfile.py -appendtop
No handlers could be found for logger "pywiki" Reading 'dict.txt'...
>>> Resource/postalCode/12698 <<<
Traceback (most recent call last):
File "pagefromfile.py", line 365, in <module> main() File "pagefromfile.py", line 361, in main bot.run() File "pagefromfile.py", line 159, in run self.put(title, contents) File "pagefromfile.py", line 188, in put if appendtops.find(self.nocontents)==-1 and appendtops.find(self.nocontents.lower())==-1:
NameError: global name 'appendtops' is not defined
I have checked the script itself but cannot see the declaration of variable 'appendtops', can anybody help? Much thanks ahead!
What needs to be bot to work on Min Wikipedia?
I'm porting my script from trunk to rewrite branch. How can I create item in wikidata?
I use this software on this site as Abcbot.
I input the text below in the cmd:
replace.py -ns:0 樹 树 -search:樹
and find this page. I pressed "y". Then it returned:
HTTPError: 500 Internal Server Error WARNING: Could not open 'http://zh.minecraftwiki.net/api.php'. Maybe the server is down. Retrying in 1 minutes... HTTPError: 500 Internal Server Error WARNING: Could not open 'http://zh.minecraftwiki.net/api.php'. Maybe the server is down. Retrying in 2 minutes... HTTPError: 500 Internal Server Error WARNING: Could not open 'http://zh.minecraftwiki.net/api.php'. Maybe the server is down. Retrying in 4 minutes... HTTPError: 500 Internal Server Error WARNING: Could not open 'http://zh.minecraftwiki.net/api.php'. Maybe the server is down. Retrying in 8 minutes... HTTPError: 500 Internal Server Error WARNING: Could not open 'http://zh.minecraftwiki.net/api.php'. Maybe the server is down. Retrying in 16 minutes...
After a while, it returned:
Traceback (most recent call last):
File "C:\Documents and Settings\user\My Documents\pywikipedia\wikipedia.py", l
ine 8902, in async_put
page.put(newtext, comment, watchArticle, minorEdit, force)
File "C:\Documents and Settings\user\My Documents\pywikipedia\wikipedia.py", l
ine 2056, in put
sysop = sysop, botflag=botflag, maxTries=maxTries)
File "C:\Documents and Settings\user\My Documents\pywikipedia\wikipedia.py", l
ine 2147, in _putPage
response, data = query.GetData(params, self.site(), sysop=sysop, back_respon
se = True)
File "C:\Documents and Settings\user\My Documents\pywikipedia\pywikibot\suppor
t.py", line 115, in wrapper
return method(*__args, **__kw)
File "C:\Documents and Settings\user\My Documents\pywikipedia\query.py", line
143, in GetData
res, jsontext = site.postForm(path, params, sysop, site.cookies(sysop = syso
p) )
File "C:\Documents and Settings\user\My Documents\pywikipedia\wikipedia.py", l
ine 6107, in postForm
cookies=cookies)
File "C:\Documents and Settings\user\My Documents\pywikipedia\wikipedia.py", l
ine 6151, in postData
f = MyURLopener.open(request)
File "C:\Python27\lib\urllib2.py", line 406, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 519, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 444, in error
return self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 527, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 503: Service Unavailable
What should I do?
I'm not sure how useful these links are, or if they should be included as translations somehow, but I am just copying the template m:Template:Pywiki-lang's content:
es - fa - fr - hu - ja - nl - pt -
Since the template will be deleted on Meta-Wiki, I figured I should at least archive the translations somewhere more relevant, maybe here.
Yes, I know. This is just an example. But is it possible in principle to search through the links on a web site and add text after each link? In Russian Wikipedia rules have changed, and now it is impossible without the consent of the administrator use spamremove.py . After linking to sites that may spread Malicious Software, it is necessary to put the template. Thank you.
I read the Traditional Chinese Version, it says you must use Monobook skin to run Pywikipediabot, is it real at present?
I am trying to setup pywikipedia on my wiki (www.imfdb.org). I cannot get it work though. I either get a "No JSON object could be decoded" error or the connection just times out. Anyone with experience using pywikipedia willing to help me out? I would be eternally grateful! Below is some of the necessary code:
imfdb_family.py
# -*- coding: utf-8 -*-
"""
This family file was auto-generated by $Id: generate_family_file.py 9734 2011-11-09 22:17:11Z valhallasw $
Configuration parameters:
url = http://www.imfdb.org/w/index.php
name = imfdb
Please do not commit this to the SVN repository!
"""
import family
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'imfdb'
self.langs = {
'en': u'www.imfdb.org',
}
self.namespaces[4] = self.namespaces.get(4, {})
self.namespaces[4]['en'] = [u'imfdb :. guns in movies :. movie guns :. the internet movie firearms database']
self.namespaces[5] = self.namespaces.get(5, {})
self.namespaces[5]['en'] = [u'imfdb :. guns in movies :. movie guns :. the internet movie firearms database talk']
self.namespaces[6] = self.namespaces.get(6, {})
self.namespaces[6]['en'] = [u'Image']
self.namespaces[7] = self.namespaces.get(7, {})
self.namespaces[7]['en'] = [u'Image talk']
def scriptpath(self, code):
return {
'en': u'/w',
}[code]
def version(self, code):
return {
'en': u'1.16.2',
}[code]
user-config.py
mylang = 'en' usernames['imfdb']['en']=u'CleanupBot' family = 'imfdb'
THANKS!