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
Hello all
>From one of my assignments as a bot operator I have some code which
does template parsing and general text parsing (e.g. Image/File tags).
It is not using regex and thus able to correctly parse nested
templates and other such nasty things. I have written those as library
classes and written tests for them which cover almost all of the code.
I would now really like to contribute that code back to the community.
Would you be interested in adding this code to the pywikibot
framework? If yes, can I send the code to someone for code review or
how do you usually operate?
Greetings
Hannes
PS: wiki userpage is http://en.wikipedia.org/wiki/User:Hannes_R%C3%B6st
Hi gurus,
I have suffered for a long time because I have quite a lot of fixes and I
can hardly find my way in this jungle and keep a logical order and find old
ones.
So I decided to write a script that creates a table of contents int
fixes.py/user-fixes.py.
Then I thought it should also list main-level variables and functions
(Python is very good at dissolving main-level things from others :-)). As I
already wrote earlier, I use several own functions for my fixes ([1]). And
also header lines of some predefined format. All this script needs a place
to insert the TOC which should be a predefined constant line, e.g.
# *** CONTENTS *** #
(If the script finds the corresponding END CONTENTS line, it clears the
previous TOC from between these two.)
But then I realized that enhanced with classes this would be useful for any
kind of scripts without extra work. For example in wikipedia.py which is
now long, long, and hard to overview.
Of course, there would be a possibility to leave some kind of data (e.g.
"no variables please, only functiions and classes"), and two approaches for
ordering (everything in original order, or fisrt the variables, then
functions, then fixes...).
Unfortunately, in some rare cases the length of a line may excced the 80
characters, which may cause PEP8 and/or Xqt beiing sad. :-)
How does this concept sound?
I will anyhow write it for my own purposes. It is just about community use
for complicated scripts such as fixes.py or wikipedia.py.
[1]
http://hu.wikipedia.org/wiki/Szerkeszt%C5%91:Bin%C3%A1ris/Fixes_and_functio…
--
Bináris
Hello! Is there a bot or extension that can generate stubs of template
descriptions by template wikitext? It should be pretty simple: the bot will
just grab all template parameters {{{PARAMETER}}} and lists those
parameters.
If no such extensions exists could anybody tell how to programaticaly get
the parameters of a given template?
Sincerely yours,
-----
Yury Katkov
I try to edit pages in a private wiki with pywikipedia. the wiki is password protected, so you cant even look at a page without logging in. While the login is working normal, I get an error that I dont have access to the api as soon as I try to actually do anything:
RuntimeError: {u'info': u'You need read permission to use this module', u'code': u'readapidenied'}
{u'info': u'You need read permission to use this module', u'code': u'readapidenied'}
The user account of the bot is active and the bot user group should have access to the api.
Does anybody have an idea how I can solve this problem?
Thank you very much!
Today, I put text to a page by my bot. pywikibot.showDiff() shows clearly
that text is removed from previous revision for 2 lines and code returns
from put() also indicate that putting succeeds
(302, 'OK', {u'pageid': ..., u'title': u'...', u'newtimestamp': u'...',
u'contentmodel': u'wikitext', u'result': u'Success', u'oldrevid': ...,
u'newrevid': ...})
However, actually the text isn't changed! History page shows me that the
text is added 1 byte (or sometimes o byte), but the content and its
previous version are really the same.
Did anyone meet this problem?
----
Sorawee Porncharoenwase
I have been working on some additions to the pywikipediabot framework.
I'd be happy if my code could be useful to others.
sync.py helps synchronizing different wikis. It goes through a bunch
of namespaces and creates an overview of pages that are different,
this is already useful for Templates and MediaWiki but especially
useful when dealing with semantic mediawiki, where a lot of the
functionality lives in namespaces such as Property, Type and Form.
linkreports.py creates a page with a table of broken links, first
date, last date and error message.
I also wrote a little PHP frontend that lets people run a
pywikipediabot replace script (it's for folks who can't or don't want
to use anything on a commandline). This can probably live on its own
on github, but it might be a bit too custom at this point and I'd like
to have some comments on it.
This PHP frontend is available at https://github.com/guaka/phpfrontforpywikibot
It's pretty rough still but releasing it forces me to think about the
public release when adding more functionality.
I'm not sure how to proceed with getting sync.py and linkreports.py in
the official repo. Shall I just put them up on github so you can take
a look? I'm looking forward to your ideas.
Kasper
Hi :),
I've found myself multiple times with user-fixes.py files that are so huge
that are difficult to manage. Therefore I did create a work around for
this:
https://github.com/Fale/ToolServer/blob/master/pywikipedia/user-fixes.py
I know that is pretty dirty code, but I think it solves a lot a problem
(the idea behind it, at least). Infact I have been able to create a
user-fixes folder
https://github.com/Fale/ToolServer/tree/master/pywikipedia/user-fixes with
a lot of well orgainzed files.
I think this feature should be moved in core.
What do you think about this?
Thanks,
Fabio
--
Fabio Alessandro Locati
Home: Segrate, Milan, Italy (GMT +1)
Phone: +39-348-2668873
MSN/Jabber/E-Mail: fabiolocati(a)gmail.com
PGP Fingerprint: 5525 8555 213C 19EB 25F2 A047 2AD2 BE67 0F01 CA61
Involved in: KDE, OpenStreetMap, Ubuntu, Wikimedia
Hi folks,
Is there a tool to hunt for overmagnified pictures and restore them? I mean
when a JPG is originally 150 px and is rendered to 300 px in the article
which is a useless enlargement and results in an ugly picture.
Or do we have any part of it, e.g. determining the size of a picture?
I think JPG is the main subject, GIFs are perhaps less involved and SVG is
of course problemless.
--
Bináris
I just wanted to put() a simple page on a MediaWiki 1.16
instance, where I have to use screen scraping (use_api=False).
There is something strange however:
There is an API call invoked by _getBlocked:
/w/api.php?action=query&format=json&meta=userinfo&uiprop=blockinfo
Here's my backtrace:
File "pywikipedia/wikipedia.py", line 693, in get
expandtemplates = expandtemplates)
File "pywikipedia/wikipedia.py", line 743, in _getEditPage
return self._getEditPageOld(get_redirect, throttle, sysop, oldid, change_edit_time)
File "pywikipedia/wikipedia.py", line 854, in _getEditPageOld
text = self.site().getUrl(path, sysop = sysop)
File "pywikipedia/wikipedia.py", line 5881, in getUrl
self._getUserDataOld(text, sysop = sysop)
File "pywikipedia/wikipedia.py", line 6016, in _getUserDataOld
blocked = self._getBlock(sysop = sysop)
File "pywikipedia/wikipedia.py", line 5424, in _getBlock
data = query.GetData(params, self)
File "pywikipedia/query.py", line 146, in GetData
jsontext = site.getUrl( path, retry=True, sysop=sysop, data=data)
getUrl(), which is also called from API, seems always
to call _getUserDataOld(text) where text is ... API output
so it tries to do strange things on that and gives warnings
like
Note: this language does not allow global bots.
WARNING: Token not found on wikipedia:pl. You will not be able to edit any page.
which is nonsense since the analyzed text is not HTML - only API output.
If getUrl() is supposed to be a low-level call, why call _getUserDataOld()
there?
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/7461
has introduced this call there.
It's easily reproducable by this:
import wikipedia
import config
config.use_api = False
wikipedia.verbose = True
s = wikipedia.getSite("pl", "wikipedia")
p = wikipedia.Page(s, u"User:Saper")
c = p.get()
c += "<!-- test -->"
p.put(c, u"Testing wiki", botflag=False)
//Saper