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/Archive00

From Botwiki
Jump to: navigation, search

Contents

EsbarduBot

Hi, I am new to pywikipedia framework. I need a bot on asturian wikipedia primarily to correct ortographic typpos. I created EsbarduBot with the last version of pywikipedia (updated subversion) and I found a problem. I think it is because of the character codification but I can't find the error. When I run login.py I obtain the next error:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xfa in position 12: ordinal not in range(128)

I am using the next user-config.py file:

mylang = 'ast'
usernames['wikipedia']['ast'] = u'EsbarduBot'
console_encoding = 'utf-8'

Using replace.py I obtain the next error:

UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 12-13: unexpected end of data

I have used the bot successfully 2 months ago, but when updating the pywikipedia package it stopped working. Does somebody have an idea of what may cause this problem and/or how to fix it? Thanks in advance --Esbardu 01:26, 28 January 2008 (UTC)

Manual:Speed_guide_for_pywikipediabot <-- Try to do the following step of this guide: This passage is optional, you can avoid it but it's really suggested. You will get the right console_encoding so you'll be able to fix the problem (or I hope so). --Filnik 09:51, 3 February 2008 (UTC)
I am having the same problem. I'm trying to upload a page to commons. I have tried setting UTF-8 everywhere. My script is preparing a wikipage, markup and all and outputting to the screen fine (including non-ascii characters. All I need is saome code to put it onto the wiki at a particular page so I added thua bit:
print output
site = wikipedia.getSite('commons', 'commons')
pagename = 'User:Inkwina/test'
page = wikipedia.Page(site, pagename)
page.put(output.encode('UTF-8'), comment=u'InkwinaBot:Update', watchArticle = True, minorEdit = False)
wikipedia.stopme()
but the script chokes on the first non-ascii charachet it find. Help I'm so frustrated i'm thinking of switching back to perl :-p
--195.158.72.225 13:05, 27 February 2008 (UTC) Inkwina on en.wikipedia

This is only a stub of code, (so I don't know if the problem is there or in other parts). By the way, you should replace the code above with:

wikipedia.output(output)
site = wikipedia.getSite('commons', 'commons')
pagename = 'User:Inkwina/test'
page = wikipedia.Page(site, pagename)
page.put(output, comment=u'InkwinaBot:Update', watchArticle = True, minorEdit = False)
wikipedia.stopme()

--Filnik 16:38, 3 March 2008 (UTC)

LibelluliaBot

Hi guys, I am having trouble getting started with the Bot. I need the Bot to move lots of articles on the Bavarian Wikipedia from one category to another.
I have installed Python 2.5.1 on my Windows XP Pro and unpacked the pywikipedia-files. I have created user-config.py containing the following:
family = 'wikipedia'
mylang = 'bar'
usernames['wikipedia']['bar'] = 'LibelluliaBot'
minthrottle = 3
maxthrottle = 60
put_throttle = 30
Now I want to proceed according to the Manual BUT: my command-line gives me an error claiming that the command "python" is either spelt incorrectly or could not be found. It does not even get as far as running login.py or anything. So I rechecked the Python installation, but all seems normal there. I checked the Help section over here but could not find any clues about my little problem.
Can somebody please tell me what to do? Any hints would be greatly appreciated. Thanks in advance, --88.134.61.59 18:52, 13 February 2008 (UTC)
OK, nevermind, thanks to your speed-guid I found out I don't need that python command at all :-) Now I am logged in. Thanks for the cool guide! --88.134.61.59 20:30, 13 February 2008 (UTC)
No problem :-) --Filnik 14:34, 15 February 2008 (UTC)

Hymie the robot

A minor question:

I'm running pywikipediabot's interwiki.py between various Uncyclopedia projects using this uncyclopedia family.py‎ configuration. It seems that, if the custom namespaces (16-whatever) have a '_default' value specified (even just '_default': u'',) then individual subprojects that don't use that particular namespace for anything generate endless warnings like:

WARNING: Family file uncyclopedia includes namespace['ro'][18], but it should be removed (namespace doesn't exist in the site)
WARNING: Family file uncyclopedia includes namespace['ro'][19], but it should be removed (namespace doesn't exist in the site)
WARNING: Family file uncyclopedia includes namespace['ro'][20], but it should be removed (namespace doesn't exist in the site)
WARNING: Family file uncyclopedia includes namespace['ro'][21], but it should be removed (namespace doesn't exist in the site)

If the '_default' is absent, the warnings go away - but then the bot abruptly halts with a fatal error if it sees a namespace name that it doesn't like. The gotisk namespaces 18-21 'got': u'𐌰𐍂𐌼𐌰𐌹𐍉', u'𐌰𐍂𐌼𐌰𐌹𐍉_𐌲𐌰𐍅𐌰𐌿𐍂𐌳𐌾𐌰', u'𐍆𐌰𐌹𐌰𐌽𐍅𐌰𐌿𐍂𐌳𐌰𐌱𐍉𐌺𐌰', u'𐍆𐌰𐌹𐌰𐌽𐍅𐌰𐌿𐍂𐌳𐌰𐌱𐍉𐌺𐌰_𐌲𐌰𐍅𐌰𐌿𐍂𐌳𐌾𐌰' are weird enough in font and name encoding to send the script looking for the defaults immediately, so removing them might not be an option.

I've previously used '_default':'' on all custom namespaces without incident; it's just after upgrading to the current SVN version of pywikipediabot that it seems to be generating warnings.

There is an uncyclopedia.py in the standard Pywikipediabot package on SVN, but that one's missing quite a few languages (there should be fifty languages in total at the moment, plus meta info & common) so isn't much use.

The bot is running and doing his tasks; I'm just wondering if there's any way to clear these warning messages? --Carlb 02:51, 11 March 2008 (UTC)

Uhm, I really don't know. I think that there's a way to clear these messages but it would be too much for me :-) so I would suggest you to use the bug trucker where there are more coders that check the questions, maybe someone can help ;-) --Filnik 11:04, 16 March 2008 (UTC) P.S. I've committed your version of uncyclopedia family on the SVN ;-)

problem with unicode pagename

Question: Did I miss something stupid? I was running the script python:revertAll.py, which calls python:userContributions.py, which had been tested here (see[1]). I am trying to use it on wikipedia:zh-yue. Then I have the following problem. It seems that the page cannot be opened, because there are conflict between encodings of strings.

Checked for running processes. 1 processes currently running, including the current process.
('edit', '10148', '160642', '0', '\xe8\xaa\xbf\xe6\x99\xaf\xe5\xb6\xba', '2008-05-07T07:47:06Z', {}, '')
Traceback (most recent call last):
  File "C:\Python25\pywikipedia1\pywikipedia\revertAll.py", line 107, in <module>
    page = wikipedia.Page(site,title)
  File "C:\Python25\pywikipedia1\pywikipedia\wikipedia.py", line 321, in __init__
    t = html2unicode(title)
  File "C:\Python25\pywikipedia1\pywikipedia\wikipedia.py", line 3613, in html2unicode
    result += text
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 0: ordinal not in range(128)

C:\Python25\pywikipedia1\pywikipedia>

Thanks. Hillgentleman 11:43, 7 May 2008 (UTC)

Try with this:
- page = wikipedia.Page(site,title)
+ page = wikipedia.Page(site,title.encode(site.encoding()))

Usually it works :-) --Filnik 14:25, 9 May 2008 (UTC)

title.encode('utf-8') doesn't work for me; unicode(title,'utf-8') seems to work better, however, I still have the following problem in wikipedia.py:
c:\Python\pywikipedia>revertall.py
Checked for running processes. 1 processes currently running, including the curr
ent process.
utf-8
('edit', '4113', '170506', '4', u'Wikipedia:\u6c99\u76d2', '2008-06-09T04:01:20Z
', {}, '')
Checked for running processes. 1 processes currently running, including the curr
ent process.
*** TITLE: Wikipedia:沙盒
*** TIMESTAMP, USERNAME, CONTENT: 2007-10-25T02:58:33Z Hillgentleman {{subst:Wikipedia:瘝

*reverting [[Wikipedia:沙盒]] to the edit at time=2007-10-25T02:58:33Z by [[user
:Hillgentleman]]
Sleeping for 4.8 seconds, 2008-06-09 13:21:34
Traceback (most recent call last):
  File "C:\Python\pywikipedia\revertAll.py", line 123, in <module>
    page.put(content, 'reverting [[' + title + ']] to the edit at ' + time + u'b
y [[user:' + userName +']]' ) # IS id A STRING??
  File "C:\Python\pywikipedia\wikipedia.py", line 1259, in put
    newPage, self.site().getToken(sysop = sysop), sysop = sysop)
  File "C:\Python\pywikipedia\wikipedia.py", line 1275, in _putPage
    encodedText = text.encode(self.site().encoding())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 46: ordinal
 not in range(128)

c:\Python\pywikipedia>

Thank you very much. Hillgentleman 05:26, 9 June 2008 (UTC)

The text is a mixed of unicode and not-unicode text, put all in unicode ("" → u""). Filnik 08:32, 9 June 2008 (UTC)

Problem when editing with my bot in my own wiki

Hello!, I've configured the pywikipedia to be used in my own wiki (here), but when I run the bot and it has to edit, it says "You can't edit page [[Portada]]". I tried giving to the account the bot flag, but the problem isn't fixed. What can I do to solve the problem? Muro de Aguas 15:29, 1 June 2008 (UTC)

Uhm, only this error? Seems strange. --Filnik 15:08, 5 June 2008 (UTC)
It could be a user privileges problem with your wiki configuration. Create a dummy user on your wiki then try editing the page. --Pietrodn 18:42, 1 September 2008 (UTC)

Changing many.. many.... many pages. :)

Ok... I am running a wiki that I need to ensure links to certain pages are standardised in their formatting and are kept up to date.

What I need to do

  • Generate a list of pages from a category
I can do this no problem
  • From this list of pages, check for an entry of |quality=xxx' where xxx is to be a dynamic entry.
  • If xxx is found then note what it is for that page.
    • If no entry is found for |quality=xxx then use a default value of poor for that article.
    • If |quality= entry is found and it is not matching a pre-defined list of 6 possible entries then save it to a seperate list to check these pages manually (or offer the chance to edit the entry and continue on).

After all of that

  • Check for pages that link to the articles from above mentioned category
  • Edit all of those pages found per above article and check the following.
    • If [[<pagename>]] then change to {{item|<pagename>|3=xxx}}
    • If {{item|<pagename>}} then change to {{item|<pagename>|3=xxx}}
    • If {{item|<pagename>|3=xxx}} but xxx does != what was found on the article itself, then offer the choice of "use what was found on the original article" (IE: the one from the category) or flag it for manual review afterwards.

*takes a breath*

Now I would like to be able to add an option so that if we run this bot again, it will check for new entries only since the last say... 3 runs and work on them only.

After an entry has been checked more than 3 times ago, then recheck it, verify it's |quality= and run through the all pages linked to it again, but skip those that have not been updated since last run....


I have a feeling it's going to be a largeish bot..... but it would be quite handy :D


This is for the Age of Conan Wiki and the category in question is Category:Items if you need a reference. Daworm 03:43, 23 June 2008 (UTC)


Looking into this I could probably just do with using Replace.py. But would need a way to do as above.
  1. Extract the |quality=xxx from articles in [[Category:Items]]
  2. If no |quality=xxx is found then use default value of 'poor'
  3. Have this saved to an xml file to then run using Replace.py.
So really what I need now I guess is a script to do the above 3 steps... Daworm 03:02, 24 June 2008 (UTC)

Bot to put the same content on a page on every wiki

It should simply put the exact same text on the same page (accounting for namespace localization) on every wiki (or some specified subset). Should be easy to do for those knowing python. This would be useful to create template-like user/user talk pages, spamming messages cross-wiki, updating templates, updating blacklists (for stewards) etc. Mike.lifeguard | @meta 00:21, 28 July 2008 (UTC)

I have a similar things to do ... I have to put a tab on my interwiki bot's user page on every wiki... For the moment I should first "initialized" the page by copy-paste the tab structure, then the update are automatized... No problem for the second part but is there a method or a script to put a large section of text (wiki code) on a specific page or list of page ? I'm not a programmer... I test the replace.py script but it doesn't support the multi-line... so somebody has an idea ? --Gdgourou 12:20, 1 August 2008 (UTC)

Rename massive number of Categories

Hello. In w:es:Wikipedia we have decided to "tidy up" the category w:es:Categoría:Películas por director renaming all "Categoría:Películas de..." to "Categoría:Películas dirigidas por...". As we can not move the categories (and so we cannot use move.py), ¿How can I make a bot for doing this? There are ≈1600 categories. My knowledge of python is very poor. Thank you very much in advance, --Lucien leGrey 16:15, 28 August 2008 (UTC)

If your knowledge of python is very poor, I would suggest not to create or modify a bot yourself. If you do not know exactly what you are doing, it can become a problem if something goes wrong... But it looks like es.wiki has a Bot requests page; w:es:Wikipedia:Bot/Solicitudes. I think you should first ask your question there. Maybe someone is willing to do this for you. --Wimmel 08:10, 29 August 2008 (UTC)

PrefixingPageGenerator

Just FYI; I am using pagegenerators.PrefixingPageGenerator to list subpages from a particular page. Until now, I ended the page with a '/', to get just the subpages, not the base page itself. But since some days, it does not work any more, probably because of a change in api.php.

For example this request (nl.wiki) returns:

<api>
    <error code="apinvalidtitle" info="Bad title ``Matrix/Archief/.''"/>
</api>

The function allpages in wikipedia.py crashes because of this... If I remove the '/', it is working perfect again.

BTW: I know that it was still working on september 2nd, which is after the Special:Allpages fix, that's why I think it is caused by a change in api.php. --Wimmel 20:22, 7 September 2008 (UTC)

Alebot

Ih all, I'm new into this community; I read previous posts and I see the I'm not been the only one to crash into unicode and UTF-8. ;-).

My present solution is:

  • I prefix my python routines with this code:
# -*- coding: utf-8 -*-
  • I wrote two brief routines to translate UTF-8 into unicode and reverse:
##unicode translations:
#utf-8->unicode
def t2u(stringa):
    return unicode(stringa,"utf-8")

# unicode->utf-8
def u2t(stringa):
    return stringa.encode("utf-8")
  • I apply u2t routine to any string I read from wiki as soon as I read it, and t2u routine just before writing anything into wiki; but I'm moving into a different and safer philosophy: to keep anything into unicode, and to use u2t routine just when I have to write strings into a local file.

This is my present wiki read/write routines:

# Reads from it.wikisource a page (full name)
def leggi_pagina(nome_pagina="Utente:Alex brollo"):
    site = wikipedia.getSite()
    page = wikipedia.Page(site, nome_pagina)
    text = u2t(page.get())
    return text

# Writes into it.wikisource a unicode string into a named page (full name), adding to previous content (aggiungi=True)
# or replacing it (aggiungi=False)
def scrivi_pagina(testo="Prova\n\n",aggiungi=True ,nome_pagina="Utente:Alebot/Sandbox"):
    site = wikipedia.getSite()
    page = wikipedia.Page(site, nome_pagina)
    if aggiungi:
        contenuto = page.get()
        page.put(unicode(contenuto+"\n\n"+testo),"utf-8")
    else:
        #print testo
        page.put(unicode(testo,"utf-8"))
    wikipedia.stopme()
    return "Fatto"

Primitive... but running. ;-) --Alex brollo 06:06, 25 October 2008 (UTC)

Also useless, the utf-8 encoding is already implemented in wikipedia.Page.get() and .put() so you have to do really nothing about that. The only problem is when you need to parse some non-wikimedia URL. --Filnik 11:08, 25 October 2008 (UTC)
When I read a wiki page with get(), I obtain a unicode string, and not a utf-8 encoded string. As you see from my codes, I have to code the unicode input content to use it. You say that I should get a utf-8 string....I obtain a unicode string and I.ve to encode it (and I'd some headache from it)..... where am I wrong? --Alex brollo 18:07, 25 October 2008 (UTC)
You should always use unicode, and write the string u"in this way" and not "in this way" (see the u). --Filnik 19:31, 25 October 2008 (UTC)
Yes, after some headache I've to review all the code to be sure that any string into my namespaces is a unicode string. Since I'm a beginner, in my first tries I found comfortable to manage normal strings (to write them into local txt files) but now I realize that's much better to have e different approach: all unicode, with a utf-8 encode just before saving them into txt files, if needed (saving data with pickle module runs without any ancoding). But... present routines run, and I'm so sad to rewrite them from scratch... :-( --Alex brollo 11:49, 26 October 2008 (UTC)
Here you'll find a set of simple xml data about Autori in it.source buildt up by Alebot: http://spreadsheets.google.com/pub?key=pXFwvJ34HVdP3FUU90W6UCg ; I don't know anything about python xml parsers, but I hope that such a data set could be useful for you just to do some tests if you like (and if you can... and I'm sure many of you can! ;-) ). --Alex brollo 11:49, 26 October 2008 (UTC)

Error when calling self.site().has_mediawiki_message within wikipedia.py

When I try to execute this simple script the page invoked is modified, but I get several errors messages. If I execute another script for example pagefromfile.py I get the same errors. I think there's something wrong with when calling the method self.site().has_mediawiki_message("spamprotectiontitle"). In fact, when I call the method within myscript.py (see commented line text2 in myscript.py) I get the same errors.

Please, can anybody help me to find out what is wrong?.


myscript.py

import wikipedia
site = wikipedia.getSite()
page = wikipedia.Page(site, u"prueba")
text = page.get(get_redirect = True)
page.put(u"hola, hola, hola, hola", u"Comentario")
line comented: text2=site.has_mediawiki_message("spamprotectiontitle")


Error messages

File "c:\xampp\python\pywikipedia\myscrip.py, line 12 in (module)
page.put(u"hola,hola,hola", u"Comentario")
File "c:\xampp\python\pywikipedia\wikipedia.py, line 1337 in putnewPage,
self.site().getToken(sysop=sysop), sysop=sysop)
File "c:\xampp\python\pywikipedia\wikipedia.py, line 1464 in _putPage
if self.site().has_mediawiki_message("spamprotectiontitle")\
File "c:\xampp\python\pywikipedia\wikipedia.py, line 4783 in has_mediawiki_message
v=self.mediawiki_message(key) 
File "c:\xampp\python\pywikipedia\wikipedia.py, line 4751, in mediawiki_message
tree=XML(decode)
File "(string)", line 85, in XML
SystaxError:XML or text declaration not at start of entity: line 2, column 0

Animula. Oct-27-2008 23:44 UTC

Finally I found out a solution changing line 4721 in wikipedia.py to force usePHP=true

if self.versionnumber() <= 12:
...

Instead of

if self.versionnumber() < 12:
...

I'm using mediawiki 1.12.0. I don´t know exactly why does it work now.

Word-by-word text parsing

I added here the page Python:Text parsing with a collection of scripts to parse into single words a txt file. It's a work-in-progess, I'll merge the code into Alebot some day. --Alex brollo 10:22, 29 October 2008 (UTC)

Cannot get bot to edit pages

I have a Mediawiki wiki that was just recently upgraded from 1.8.6 to 1.13.3. I had pywikipedia bot working on the old wiki, but I could not get it to work with the new version (my pywikipedia version was at least a year old). I just downloaded the latest nightly build of pywikipedia bot and set it up with my user-config.py and my updated family file.

I can get the bot to login properly, but I get an error every time I try to access a page. For example, this command:

python protect.py -unprotect -page:myPage

Gives this output:

Checked for running processes. 1 processes currently running, including the current process.
Enter a reason for the protection: test
Processing page myPage
none none
Sleeping for 3.5 seconds, 2009-02-25 18:25:36
Failed to change protection level of page myPage:
HTTP response code 200 

All commands I try return the HTTP 200 (OK) response. Any suggestions on what I'm doing wrong?

secure servers

How can run bot in secure servers.or can we run in it?79.132.198.8 21:41, 9 April 2009 (UTC)

SSL support has been added recently, see SVN (example). --87.173.198.243 22:54, 10 April 2009 (UTC)

Basic Bot Tests Failing

I was learning how to use Pywikipediabot via the course on Wikiversity, but the test scripts aren't working. I'm using python in Windows, via cmd.exe. When I try to run a script that contains: <source lang="python"><nowiki> #!/usr/bin/python # -*- coding: utf-8 -*- # let's declare all global values here mydir = "./" pwbdir = mydir + "pywikipedia/" language = "en" family = "wikinews" mynick = "My Bot Name" hello_world = "Hello, world!" myuserpage = "User:" + mynick mypage = myuserpage + "/" + hello_world # importing modules import sys sys.path.append(pwbdir) from wikipedia import * # doing the job site = getSite(language,family) page = Page(site,mypage) page.put(hello_world) </source>

It gives me: ...line 17, in <module>

from wikipedia import *

ImportError: No module named wikipedia

I know next to nothing about Python. Can anyone tell me what is going wrong? Thanks, 99.224.117.66 19:31, 26 April 2009 (UTC)

Script to put titles to external links

Hi all! Is there any script which put titles to external links with no title? I mean do this change: "[http://www.wikipedia.org]" → "[http://www.wikipedia.org Wikipedia]". reflinks.py doesn't work if the external link isn't between <ref> and </ref>. Thanks in advance. Muro de Aguas 14:20, 19 June 2009 (UTC)

Mass-articles renaming

Hello, i need to rename array of articles on my local wiki. I try to add to their names regular postfix. For example, old page name was: "Some pagename", and new will be: "Some pagename (postfix)". And this operation i want apply to articles in some category.

I can't find realization of this in standart Pywikipedia Bot. Can you advise me something? Thanks.

PS. Sorry for my poor english. --217.14.197.61 08:03, 22 June 2009 (UTC)

Nobody replyes, so i write it by myself:
#!/bin/sh
function renamepage()
{
oldname="$1"
echo "$oldname"
python replace.py -ref:"$oldname" "$oldname" "$oldname (postfix)" -always -putthrottle:1 </dev/null
python movepages.py -from:"$oldname" -to:"$oldname (postfix)" -del -putthrottle:1 </dev/null
echo "Rename" | python delete.py -page:"$oldname" -always
}
while read line
do
   renamepage "$line"
done < "pagelist"
All pages are in "pagelist" file. Example "pagelist":
Page 1
Page 2
Page 3
With each article in "pagelist" it adds to all links in referred pages a new postfix, next renames the article and at last it removes page-redirect.
--217.14.197.61 09:54, 30 June 2009 (UTC)

Hello!

  • Hi, I posted this on another page as well and I think I may have placed it incorrectly, so sorry about that. However I'm an administrator at a wiki and we have had problem with vandals lately. We need a bot that will help us so that if there are not very many users online it can be dealt with quickly. Thank you!--98.207.64.254 00:02, 13 September 2009 (UTC)

Bot doesn`t see the article

Hello!

I got some troubles while using add-text.py bot on my own wiki-site. It starts normally, gets the category. Then following message comes:

Note: this language does not allow global bots.
Loading %pagename%...
Getting page [[%pagename%]]
Request ru:/wiki/api.php?action=query&format=json&meta=userinfo&uiprop=blockinfo
Note: this language does not allow global bots.
%pagename% doesn't exist, skip!
Traceback (most recent call last):
  File "%path%/pywikipedia/add_text.py", line 312, in <module>
    main()
  File "%path%/pywikipedia/add_text.py", line 308, in main
    (text, newtext, always) = add_text(page, addText, summary, regexSkip, regexSkipUrl, always, up, True)
ValueError: need more than 2 values to unpack

%pagename%, %path% - i put it here instead of real names. May be I should "turn on" global bots on my wiki somehow? I have mediawiki 1.15.1, python 2.6.2, pywikipedia 7282 installed. I`ll be glad to get any help, `cause this is first time I use pywikipedia bots.

Problem with editing page in extern wiki

Hello, first sorry for my English, I now it is not really good :-/ I hope you will understand me.
I want to make a bot for my own wiki and i followed the instructions and i do not have problems with logging in - but editing pages does not work. I wanted to test category.py to add one category on one page, and that followed (i removed the url):
WARNING: No text area found on www.xxx.de/index.php?title=Metin2Wiki%3ASpielwiese&action=edit&useskin=monobook. Maybe the server is down. Retrying in 1 minutes...
The is NOT down and the name of the URL and page is right. I think the problem is the skin, because i changed the skin of the wiki and deleted the MonoBook-skin. Is it possible that this is my problem? Or am I mistaken? -- 91.115.85.211 14:56, 1 October 2009 (UTC)

Request for a bot

Hello, I am hoping to find somebody who is willing to help me with the following. I would like to have a bot that uses a file with information to add or replace parameters in an infobox template.

In this case: I would like to use a list of all Philippine municipalities with their current mayors (and an additional column with the province in which the municipality is located) to update or insert the mayor name on the relevant municipality page on the Dutch wikipedia.

One of the other users on nl.wikipedia suggested it should be programmed something like:

  1. Start reading the list
  2. Check for a article <municipality name>. Does it exist?
    1. If yes: check for the existence of template "Sjabloon:Infobox plaats in de Filipijnen".
      1. If true: Continue at step 3.
      2. If false Go to step 2.2.
    2. If not: Check for the existence of an article <municipality name> (<province name>).
      1. If yes: proceed
      2. if not: Give up on it and remember the specific municipality to add manually later.
  3. Search for "| burgemeester = .*" in the article and delete it and go to step 4 or the next municipality. (note: burgemeester is the Dutch word for mayor)
  4. Add "| burgemeester = <mayor name>" at the appropriate place.

I hope somebody can help me to program a script. Magalhães 12:50, 26 October 2009 (UTC)

Anyone? Magalhães 12:30, 17 November 2009 (UTC)

How to loop through a category?

How does one loop through a category using the Pywikipedia library? PiRSquared17 18:51, 25 April 2010 (UTC)

Removal of an unethical tag from Sinhala Wikipedia articles

We at Sinhala Wikipedia require to remove an unethical tag from certain articles. We require to make a bot for that purpose. The tag is in English and reads as:

"This article has been translated from the English wikipedia by felidae, http://www.felidae.lk. This initiative is sponsored by the Information and Communication Technology Agency of Sri Lanka (ICTA), http://www.icta.lk. Support and access to rural communities provided by Practical Action (formerly ITDG), http://practicalaction.org/?id=region_south_asia."

We require your help and guidance please. Thanks --- චතුනි අලහප්පෙරුම 05:30, 26 May 2010 (UTC)

Could you show an example page that has this tag? Mike.lifeguard | @meta 19:25, 28 May 2010 (UTC)

Require even number of replacements

What's the problem? my user-fixes.py is correct... what's the correct syntax?

Ho un problema con il mio user-fixes.py; il file è corretto perché ho provato a scaricarne altri da Internet e danno lo stesso risultato: questo benedetto errore "Require even number of replacements". Dove sto sbagliando?

C:\pywikipedia>replace.py -fix:user-fixes.py -errori_comuni
Traceback (most recent call last):
  File "C:\pywikipedia\replace.py", line 719, in <module>
    main()
  File "C:\pywikipedia\replace.py", line 582, in main
    raise pywikibot.Error, 'require even number of replacements.'
pywikibot.exceptions.Error: require even number of replacements.

Se al termine della sintassi aggiunto -x (dove x è un numero) viene:

Traceback (most recent call last):
  File "C:\pywikipedia\replace.py", line 719, in <module>
    main()
  File "C:\pywikipedia\replace.py", line 603, in main
    'Specifying -fix with replacements is undefined')
pywikibot.exceptions.Error: Specifying -fix with replacements is undefined

Aiuto! Help me! --HAL9000 14:08, 31 May 2010 (UTC)

I guess
replace.py -fix:errori_comuni
will do the job. -Xqt 08:38, 25 September 2010 (UTC)

adding interwiki links to a wikipage - help

Hi, I'm new with python and wikipedia. I'm working to build a script to add new links to a page. What i want to do is lookup a list of words in wikipedia (and other wikis) to find related pages and then add the links to the page i'm working with. I know how to do this the long way, but i wanted to know if pywikibot has a special module for doing this.

Your help is greatly appreciated!

Is the cmd not something like "python interwiki.py page_I_working_on -hintfile:list_of_words.txt"

And list_of_words.txt is text file with the words in [[]]'s. Carsrac 00:06, 31 December 2010 (UTC)

KeyError when using login.py

I get the following error:

$ python login.py
Password for user Waterbot on sumov:sumov: 
Logging in to sumov:sumov as Waterbot via API.
Traceback (most recent call last):
  File "login.py", line 436, in <module>
    main()
  File "login.py", line 432, in main
    loginMan.login()
  File "login.py", line 319, in login
    cookiedata = self.getCookie(api)
  File "login.py", line 182, in getCookie
    result = data['login']['result']
KeyError: 'login'

Why is that? —Waterfox 14:14, 20 August 2010 (UTC)

Benveutare

Benvenutare è orribile !!!! Per farove Dare il benventuo è molto meglio ! Non ho cambiato la main page solo perchè nuovo, ma insomma... benvenutare !!!!!

Archive bot

Hello ;)
At first I want to say "Excuse me!" because I'm not good at writing or speaking English.
I need a bot for a private MediaWiki project. The bot should archive the talk pages. I know nothing about programming pywikipedia bots. Could somebody tell me everything about this? I'm very brainless :)
-- epress (Talk) 23:05, 31 October 2010 (UTC)

python interwiki.py -untranslatedonly

That cmd doesn't work anymore or is it a local problem??? Carsrac 23:50, 30 December 2010 (UTC)

Personal tools
Share
In other languages