Purple exclamation mark.svg Planning the future of Botwiki! - Help us bring Botwiki up to date, contribute to our strategy discussion, add bot scripts, and contribute manuals, guides, and tutorials! Almost anything related to bots, particularly those used to edit mediawiki, is welcome.

Red exclamation mark.svg UNABLE TO EDIT? - We've experienced attacks by spambots lately and now require you to confirm your e-mail before you can edit (go to your preferences, enter an e-mail address, and request a confirmation e-mail, then go to your e-mail and click on the confirmation link). We also require new accounts to make a few edits and wait a few minutes before before you can create a page; however, if this is a problem contact us in #botwiki and we can manually confirm your account. Sorry for the inconvenience.

Botwiki:Bot helpboard/archive1

From Botwiki
Jump to: navigation, search

Contents

Bug ?

Hi. I'm a new pywikipediabot user. I'm trying to use this bot on desencyclopedie.wikia.com (french uncyclopedia). Some scripts run perfectly (category.py, redirect.py, standardize_interwiki.py...), but the interwiki.py (which could be very useful for us) isn't working. I always get the following error message : Got incorrect export page. Sleeping for 15 seconds... with increasing times. Does somebody have an idea of what may cause this problem and/or how to fix it ? Example :

[pirk@... pywikipedia]$ python ./interwiki.py
Checked for running processes. 1 processes currently running, including the curr
Missing main page name
Which page to check: AAAAAAAAA!
Getting 1 pages from uncyclopedia:fr...
[[AAAAAAAAA!]]: [[fr:AAAAAAAAA!]] gives new interwiki [[he:א]]
[[AAAAAAAAA!]]: [[fr:AAAAAAAAA!]] gives new interwiki [[pl:Aaaaa]]
[[AAAAAAAAA!]]: [[fr:AAAAAAAAA!]] gives new interwiki [[sv:AAAAAAAAA!]]
[[AAAAAAAAA!]]: [[fr:AAAAAAAAA!]] gives new interwiki [[en:AAAAAAAAA!]]
[[AAAAAAAAA!]]: [[fr:AAAAAAAAA!]] gives new interwiki [[eo:Aaaaa]]
[[AAAAAAAAA!]]: [[fr:AAAAAAAAA!]] gives new interwiki [[el:ΑΑΑΑΑΑΑΑΑ!]]
[[AAAAAAAAA!]]: [[fr:AAAAAAAAA!]] gives new interwiki [[de:AAAAAAAAA!]]
[[AAAAAAAAA!]]: [[fr:AAAAAAAAA!]] gives new interwiki [[cs:AAAAAAAAA!]]
[[AAAAAAAAA!]]: [[fr:AAAAAAAAA!]] gives new interwiki [[es:AAAAAAAAA!]]
[[AAAAAAAAA!]]: [[fr:AAAAAAAAA!]] gives new interwiki [[zh-tw:喵喵喵喵喵!]]
[[AAAAAAAAA!]]: [[fr:AAAAAAAAA!]] gives new interwiki [[pt:AAAAA!]]
[[AAAAAAAAA!]]: [[fr:AAAAAAAAA!]] gives new interwiki [[nl:AAAAAAAAA!]]
[[AAAAAAAAA!]]: [[fr:AAAAAAAAA!]] gives new interwiki [[ja:あああああああああ!]]
Getting 1 pages from uncyclopedia:he...
Getting 1 pages from uncyclopedia:pl...
Sleeping for 9.9 seconds, 2007-06-14 17:15:13
[[AAAAAAAAA!]]: [[pl:Aaaaa]] gives new interwiki [[ko:햏]]
[[AAAAAAAAA!]]: [[pl:Aaaaa]] gives new interwiki [[ast:¡AAAAAAAAA!]]
NOTE: [[AAAAAAAAA!]]: [[pl:Aaaaa]] gives duplicate interwiki on same site [[zh-t
Getting 2 pages from uncyclopedia:zh-tw...
Got incorrect export page. Sleeping for 15 seconds...
Got incorrect export page. Sleeping for 30 seconds...

--Goldorak 22:11, 6 July 2007 (GMT)

login.py failure

When I try to log in to my wiki to run my bot, I get the following:

Traceback (most recent call last):
 File "./login.py", line 277, in ?
   main()
 File "./login.py", line 273, in main
   loginMan.login()
 File "./login.py", line 225, in login
   cookiedata = self.getCookie()
 File "./login.py", line 144, in getCookie
   response, data = self.site.postForm(address, predata, useCookie=False)
 File "/home/doug/research/god/bibliowiki/pywikipedia/wikipedia.py", line 3137, in postForm
   return self.postData(address, data, sysop = sysop, useCookie=useCookie)
 File "/home/doug/research/god/bibliowiki/pywikipedia/wikipedia.py", line 3160, in postData
   conn.endheaders()
 File "/usr/lib/python2.4/httplib.py", line 798, in endheaders
   self._send_output()
 File "/usr/lib/python2.4/httplib.py", line 679, in _send_output
   self.send(msg)
 File "/usr/lib/python2.4/httplib.py", line 646, in send
   self.connect()
 File "/usr/lib/python2.4/httplib.py", line 614, in connect
   socket.SOCK_STREAM):
socket.gaierror: (-2, 'Name or service not known')

I set up user-config.py and the family file for my wiki. Does anyone have any advice where to look to track down the problem?

Try to upgrade your bot framework ($ svn update if you are using subversion) and run the bot with python2.5: $ python2.5 bot.py. Python 2.5 is installed by default in almost all linux distributions; if not, it can be downloaded from http://www.python.org/. The problem seams to come from /usr/lib/python2.4/httplib.py and this library is upgraded with the new version of python.--Iradigalesc 17:37, 9 November 2007 (UTC)
I think it is a DNS error. Which family are you using? Bryan 21:32, 15 November 2007 (UTC)

Whatever happened to understanding special letters in commands?

Previously if you entered a command, that included special characters (like éáúüöó), the bot would execute it finely (maybe except the letters ű and ő), now, it doesn't seem to do anymore.

For example, this command would have just run fine without error previously, and now it results in the following errors:

C:\p>category.py move -from:"Nemzeti labdarúgó szövetségek" -to:"Nemzeti labdarúgó-szövetségek"
Checked for running processes. 1 processes currently running, including the current process.
Getting Kategória:Nemzeti labdarˇg? sz÷vets?gek...
Target link 'wikt:Kategória:Nemzeti_labdarˇg?_sz÷vets?gek' has different family 'wikt'
Getting 1 pages from wikipedia:hu...
Getting 1 pages from wiktionary:hu...
ERROR: Speciális:Search/Nemzeti labdarˇg? sz÷vets?gek is not in category Kategória:Nemzeti labdarˇg? sz÷vets?gek!
ERROR: wiktionary:hu:Kategória:Nemzeti labdarˇg? sz÷vets?gek is not in category Kategória:Nemzeti labdarˇg? sz÷vets?gek!
There are no subcategories in category Kategória:Nemzeti labdarˇg? sz÷vets?gek Dumping to category.dump.bz2, please wait...

If I remember the trick was to set the console encoding to utf-8, but it doesn't seem to solve the problem anymore.

Your help is much appreciated, regard Dami--77.234.77.198 12:36, 11 November 2007 (UTC)

I've already seen this error in this last days (I'll ask, hoping that someone knows what's the problem..) but, for category.py you can use the % links! For example, try with:

category.py move -from:"Nemzeti_labdar%C3%BAg%C3%B3_sz%C3%B6vets%C3%A9gek" -to:"Nemzeti_labdar%C3%BAg%C3%B3-sz%C3%B6vets%C3%A9gek"

You can get the "percent url" looking at the url in your browser. Bye, --Filnik 12:56, 11 November 2007 (UTC)

Yeah, but its frustrating to do if you know the name of the categories, and normally you wouldn't have to look. Also its frustrating, because it worked just fine in the past. And thirdly, modern browsers don't or shouldn't display the "percent url" but only the "normal".Dami--77.234.77.198 13:04, 11 November 2007 (UTC)
I know, but I don't see other solutions (I don't know what's the real problem :-( ). --Filnik 13:38, 18 November 2007 (UTC)

Thanks, I sent my question to the mailing list, maybe someone there knows a solution. --Dami--77.234.82.203 13:03, 19 November 2007 (UTC)

Lonelypages

I try to use Python:Lonelypages.py, but when I try to use it, I get an error about 10 pages in.

Traceback (most recent call last):
  File "Uncat.py", line 90, in ?
    main()
  File "Uncat.py", line 56, in main
    refsList = refsList.append(j)
AttributeError: 'NoneType' object has no attribute 'append'

(Maybe) Fixed, retry please :-) (if you enter in pywikipediabot chat, maybe we can help you more quickly  ;-)). --Filnik 16:11, 20 November 2007 (UTC)

Checkimages

Hi! First of all thanks for this new script! I'm having a problem running it on huwiki though. I translated the right messages, and when I try to run it I get this error:

c:\pywikipedia>checkimages.py
Checked for running processes. 2 processes currently running, including the curr
ent process.
Retrieving the lastest 80 files for checking...
'utf8' codec can't decode bytes in position 15341-15342: invalid data
ERROR: Invalid characters found on http://hu.wikipedia.org/w/index.php?title=Spe
cial:Log&type=upload&user=&page=&pattern=&limit=80&offset=0, replaced by \ufffd.

Exception in Page constructor
site=wikipedia:hu, title=None, insite=wikipedia:hu, defaultNamespace=0
Traceback (most recent call last):
  File "c:\pywikipedia\checkimages.py", line 749, in <module>
    tupla_written = mainClass.takesettings(settings)
  File "c:\pywikipedia\checkimages.py", line 485, in takesettings
    x = wikipedia.Page(self.site, settings)
  File "c:\pywikipedia\wikipedia.py", line 315, in __init__
    t = html2unicode(title)
  File "c:\pywikipedia\wikipedia.py", line 3342, in html2unicode
    text = text[i:]
TypeError: 'NoneType' object is unsubscriptable

I'm not totaly sure whether this problem was there already, or I introduced it with the translation..., I tried changing the language of my Bot Wikipedia profile to English, but it doesn't help..

Here are my translations, so you can check, whether I introduced the problem, and if not, than include this in the source:

#########################################################################################################################
# <------------------------------------------- Change only below! ----------------------------------------------------->#
#########################################################################################################################

# That's what you want that will be added. (i.e. the {{no source}} with the right day/month/year )
n_txt = {
        'commons':'\n{{subst:nld}}',
	'en'     :'\n{{subst:nld}}',
	'it'     :'\n{{subst:unverdata}}',
	'hu'     :u'\n{{nincslicenc|~~~~~}}',
	}

txt_find =  {
	'commons':['{{no license', '{{nld'],
        'en':['{{nld', '{{no license'],
	'it':['{{unverdata', '{{unverified'],
	'hu':[u'{{nincsforrás',u'{{nincslicenc'],
                }

# Summary for when the will add the no source
comm = {
		'commons':'Bot: Marking newly uploaded untagged file',
		'en'     :'Bot: Marking newly uploaded untagged file',
		'it'     :"Bot: Aggiungo unverified",
		 'hu'    :'Robot: Frissen feltöltött licencsablon nélküli fájl megjelölése',
		}

# Summary that the bot use when it notify the problem with the image's license
comm2 = {
		'commons':"Bot: Requesting source information." ,
		'en'     :"Bot: Requesting source information." ,
		'it'     :"Bot: Notifico l'unverified",
		'hu'     :'Robot: Forrásinformáció kérése',
		}

# When the Bot find that the usertalk is empty is not pretty to put only the no source without the welcome, isn't it?
empty = {
		'commons':'{{subst:welcome}}\n~~~~\n',
		'en'     :'{{welcome}}\n~~~~\n',
		'it'     :'{{benvenuto}}\n~~~~\n',
		'hu'     :u'{{subst:Üdvözlet|~~~~}}\n',
		}

# General summary
unver = {
		'commons':'Bot: no source',
		'en'     :'Bot: no source',
		'it'     :'Bot: Unverified!',
		'hu'     :'Robot: nincs forrás',
		}

# if the file has an unknown extension it will be tagged with this template.
# In reality, there aren't unknown extension, they are only not allewed... ^__^
delete_immediately = {
					'commons':"{{db-meta|The file has .%s as extension.}}",
					'en'     :"{{db-meta|The file has .%s as extension.}}",
					'it'     :'{{cancella subito|motivo=Il file ha come estensione ".%s"}}',
					'hu'     :u'{{azonnali|A fájlnak .%s a kiterjesztése}}',
					}

# The header of the Unknown extension's message.
delete_immediately_head = {
						'commons':"\n== Unknown extension! ==\n",
						'en'     :"\n== Unknown extension! ==\n",
						'it'     :'\n== File non specificato ==\n',
						'hu'     :u'\n== Ismeretlen kiterjesztésű fájl ==\n',
						}

# Text that will be add if the bot find a unknown extension.
delete_immediately_notification = {
						'commons':'The [[:Image:%s]] file has a wrong extension, please check. ~~~~',
						'en'     :'The [[:Image:%s]] file has a wrong extension, please check. ~~~~',
						'it'     :'{{subst:Utente:Filbot/Ext|%s}}',
						'hu'     :u'A [[:Kép:%s]] fájlnak rossz a kiterjesztése, kérlek ellenőrízd. ~~~~',
						}
# Summary of the delate immediately. (f.e: Adding {{db-meta|The file has .%s as extension.}})
del_comm = {
			'commons':'Bot: Adding %s',
			'en'     :'Bot: Adding %s',
			'it'     :'Bot: Aggiungo %s',
			'hu'     :u'Robot:"%s" hozzáadása',
			}

# This is the most important header, because it will be used a lot. That's the header that the bot
# will add if the image hasn't the license.
nothing_head = {
				'commons':"",# Nothing, the template has already the header inside.
				'en'     :"\n== Image without license ==\n",
				'it'     :"\n== Immagine senza licenza ==\n",
				'hu'     :u"\n== Licenc nélküli kép ==\n",
				}
# That's the text that the bot will add if it doesn't find the license.
nothing_notification = {
				'commons':"{{subst:User:Filnik/untagged|Image:%s}}Image:%s}}\n\n''This message was '''added automatically by [[User:Filbot|Filbot]]''', if you need some help about it, ask [[User:Filnik|its master]] or go to the [[Commons:Help desk]]''. --~~~~",
				'en'     :"{{subst:image source|Image:%s}} --~~~~",
				'it'     :"{{subst:Utente:Filbot/Senza licenza|%s}} --~~~~",
				'hu'     :u"{{subst:adjforrást|Kép:%s}}\nEzt az üzenetet ~~~ automatikusan helyezte el a vitalapodon, kérdéseddel fordulj a gazdájához, vagy a [[WP:KF|Kocsmafalhoz]]. --~~~~",
				}
# This is a list of what bots used this script in your project.
# NOTE: YOUR Botnick is automatically added. It's not required to add it twice.
bot_list = {
			'commons':['Siebot', 'CommonsDelinker'],
			'en'     :['OrphanBot'],
			'it'     :['Filbot', 'Nikbot', '.snoopyBot.'],
			}

# The message that the bot will add the second time that find another license problem.
second_message_without_license = {
				'commons':None,
                                'en': None,
				'it':'{{subst:Utente:Filbot/Senza licenza2|%s}} --~~~~',
				'hu':u'\nSzia! Úgy tűnik a [[:Kép:%s]] képpel is hasonló a probléma, mint az előbbivel. Kérlek olvasd el a [[WP:KÉPLIC|feltölthető képek]]ről szóló oldalunk, és segítségért fordulj a [[WP:KF-JO|Jogi kocsmafalhoz]]. Köszönöm --~~~~',
				}
# You can add some settings to wikipedia. In this way, you can change them without touch the code.
# That's useful if you are running the bot on Toolserver.
page_with_settings = {
					'commons':None,
                                        'en':None,
                                        'hu':None,
					'it':'Utente:Nikbot/Settings#Settings',
					}
# The bot can report some images (like the images that have the same name of an image on commons)
# This is the page where the bot will store them.
report_page = {
				'commons':'User:Filbot/Report',
                                'en'     :'User:Filnik/Report',
				'it'     :'Utente:Nikbot/Report',
				'hu'     :'User:Bdamokos/Report',
				}
# Adding the date after the signature. 
timeselected = u' ~~~~~'
# The text added in the report
report_text = {
			'commons':"\n*[[:Image:%s]] " + timeselected,
			'en':"\n*[[:Image:%s]] " + timeselected,
			'it':"\n*[[:Immagine:%s]] " + timeselected,
			'hu':u"\n*[[:Kép:%s]] " + timeselected,
			}
# The summary of the report
comm10 = {
		'commons':'Bot: Updating the log',
		'en':'Bot: Updating the log',
		'it':'Bot: Aggiorno il log',
		'hu': 'Robot: A napló frissítése',
		}

# If a template isn't a license but it's included on a lot of images, that can be skipped to
# analise the image without taking care of it. (the template must be in a list)
HiddenTemplate = {
		'commons':['{{information'],
		'en':['{{information'],
		'it':['{{edp', '{{informazioni file', '{{information'],
		'hu':[u'{{információ','{{enwiki', '{{azonnali'],
		}

# Add your project (in alphabetical order) if you want that the bot start
project_inserted = ['commons', 'en','hu', 'it']

--Dami 16:01, 27 November 2007 (UTC)

I've added the translations, I hope that now it's ok. Byez, --Filnik 16:27, 27 November 2007 (UTC)

Thanks for the quick fix! Please make sure all Hungarian messages are "unicoded", especially at line 121. Thanks again--85.238.79.242 17:00, 27 November 2007 (UTC)

I removed above a space from one of the Hungarian messages, so its nicer on the talk pages. Is there a way to have the robot not use minor edits? Because if you edit as a bot a talk page and mark it minor, than the user doesn't get a notification about it...--Dami 10:52, 28 November 2007 (UTC)

Seems that all the messages are unicoded correctly and, for the Dami's question, the bot already make the talk page change not as minor. Other issues? :-) Bye, --Filnik 17:45, 29 November 2007 (UTC)
Thanks for the fixes, and sorry for the minor thing, I tested it on my talkpage and the messages on the talk pages are really fine. Kee p up the good work! --Dami 21:53, 10 December 2007 (UTC)
No problem :-) Thank you for using Botwiki ^_- Bye, --Filnik 15:46, 12 December 2007 (UTC)
Personal tools
Share
In other languages