Happy Monday,
There are strange people who make such links (kindof urlencoded?):
[[Második világháború#Partrasz.C3.A1ll.C3.A1s Szic.C3.ADli.C3.A1ban
.28Huskey hadm.C5.B1velet.29|Huskey hadműveletben]]
So the section title must have been copied from the URL.
Do we have a ready tool to fix these?
--
Bináris
Hi folks,
a long time ago in a very near galaxy I worked a lot with disambiguation
pages. Those times there was some tool to list them ordered by number of
references, so as we knew which disambiguation page to work on.
The tool was not perfect for us for multiple reasons, and we don't find it
any more
<https://hu.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Botgazd%C3%A1k_%C…>.
So I decided to write a script, here it is:
https://hu.wikipedia.org/wiki/Szerkeszt%C5%91:BinBot/disambcounter.py
Feel free to use it.
One idea is that number of references is not useful in itself. So number of
referring templates will be counted separately, because in many cases the
number of references may be drastically decreased by manual edit of a few
templates (navboxes, infoboxes, userboxes etc.). In Hungarian Wikipedia
botless users helped to correct a lot of bad references caused by these
templates. After this we get a clearer number of references to be corrected
by bot.
The other point of view was that many disambiguation pages are just
disturbing, and we don't want to work on them, so we can exclude them from
listing. In huwiki these were the disambiguation pages of bus/metro/tram
lines which crosslink to each other, generating 110 thousend bad
references, and they are about 3-400. They flooded the beginning of the
list, but now they don't flood any more.
You may also set the namespaces, where to count. As we often don't correct
references in talk namespaces, we don't want to count them. Now we have a
list that is useful to choose the subejct of botwork.
--
Bináris
We have a long term vandal who finds his pleasure in decorating user pages
with obscene pictures, and users often want them to be hiden from page
history.
Can Pywikibot do this for me? I would give the user name of the vandal, and
the bot would mass hide the contents (or contents, comment, user name) of
the versions. Of course, with admin rigths.
--
Bináris
Hi,
I have
target = pywikibot.Page(site, uploadPage)
oldtext = target.get()
<long computing>
target.put(pretext + text, uploadComment)
pywikibot.exceptions.EditConflict: An edit conflict has occured.
So, is the likelihood of an edit conflict connected to elpased time between
instantiation and put(), or between get() and put()?
Is it useful to reinstantiate the page?
Is it useful to give a second chance to put() in case of edit conflict, or
loop it?
--
Bináris
Hi,
I'm playing with pywikibot. I have a mediawiki on my local machine, for
testing.
I want to extract the text from a page in it, the page being <
http://127.0.0.1/mw/index.php/Cabalamat:Test_Article>,
so I have tried this code:
localMw = pywikibot.Site(
url="http://127.0.0.1/mw/index.php/")
page = pywikibot.Page(localMw, "Cabalamat:Test_Article")
however, I get this error message:
Traceback (most recent call last):
File "simple.py", line 27, in <module>
url="http://127.0.0.1/mw/index.php/")
File
"/home/phil/sproj/wfbots/venv/local/lib/python2.7/site-packages/pywikibot/__init__.py",
line 1214, in Site
raise SiteDefinitionError("Unknown URL '{0}'.".format(url))
pywikibot.exceptions.SiteDefinitionError: Unknown URL '
http://127.0.0.1/mw/index.php/'.
<class 'pywikibot.exceptions.SiteDefinitionError'>
CRITICAL: Closing network session.
Looking at the documentation, it says <
https://doc.wikimedia.org/pywikibot/api_ref/pywikibot.html#pywikibot.Site>:
*url* (*string*) – Instead of code and fam, does try to get a Site based on
the URL. Still requires that the family supporting that URL exists.
>From this I get the impression that pywikibot has a list of mediawiki sites
that it recognises, and if a site isn't on that list, it won't work.
Is that correct or am I misunderstanding something?
--
Phil Hunt, <cabalamat(a)gmail.com>