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
Having problems with pageimport.py on a third-party wiki (WikiQueer). Anyone else having issues with that script?
I'm calling it from a script I'm playing around with - but no luck. It doesn't error out - but it doesn't import and confirms that the import failed.
Here's the "test" script I'm working from:
import wikipedia as pywikibot
from pageimport import *
def main():
wanted_category_title = "Apple"
enwiki_site = pywikibot.getSite()
importerbot = Importer(enwiki_site) # Inizializing
importerbot.Import(wanted_category_title,project='wikipedia', prompt = True)
try:
main()
finally:
pywikibot.stopme()
On a related note, the ultimate goal is to import pages for "Wanted Categories" from English Wikipedia into the third-party wiki. Any ideas, tips or existing code to that end would also be appreciated.
Thanks!
-greg aka varnent
-------
Gregory Varnum
Lead, Aequalitas Project
Lead Administrator, WikiQueer
Founding Principal, VarnEnt
@GregVarnum
fb.com/GregVarnum
Dear all
I have posted to this mailing list in January with a library that I
wanted to contribute to the codebase. This is part of an effort on my
side to refactor code that accumulated over various bot-operator tasks
and make it available to the community. The main part of the code
deals with spellchecking using hunspell
(http://hunspell.sourceforge.net/) instead of the list-based approach
currently used in spellcheck.py. The second part is an interactive
robot to do revision control (Sichten) in the german wikipedia. There
are some api functions that use the "undo" functions of the
action=edit command and an api function that uses the action=review
command.
So I wanted to ask whether somebody had time to have a look at the
code I submitted here
http://sourceforge.net/tracker/?func=detail&aid=3479070&group_id=93107&atid…
(I uploaded a new file "(moved testSamples)" please us this to test,
the other one seems corrupt and cannot be deleted any more as well).
Thus, is there a code-review process that I can undergo or what do you
suggest is the best way to get the code into trunk (if at all?). Would
it be easier if I talked directly to one of you?
What are the criteria to get SVN commit access -- I was just wondering
what the general rules are.
Greetings
Hannes
Hi,
I would like to join in Python Wikipedia Robot Framework project in
Sourceforge.
Some of my contribution:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=3509841&group_…
.
Currently I have been doing Picasa batch upload automated script.
I kindly request to add me in this project
Regards,
Jenith
Pywikipedia (r10475 (wikipedia.py), 2012/08/09, 16:51:37)
wikipedia.py seems to have the same bug in two places.
At lines 2976 and 3145:
if 'query-continue' in result and getAll:
params['rvstartid'] = ...
where ... is:
result['query-continue']['revisions']['rvstartid']
Fix is to change "rvstartid" to "rvcontinue":
result['query-continue']['revisions']['rvcontinue']
# Demonstrate problem by running following.
# Get a long history list from en.wikipedia.org.
import wikipedia
site = wikipedia.getSite(fam='wikipedia')
page = wikipedia.Page(site, 'Ahalya')
hist = page.getVersionHistory(getAll=True)
print 'len(getVersionHistory()) = %d' % len(hist)
Calling getVersionHistory() raises an exception at line 2977:
KeyError: 'rvstartid'
That is fixed by making the change shown above; output:
len(getVersionHistory()) = 1256
John
>
>
> From: Yury Katkov <katkov.juriy(a)gmail.com>
> To: MediaWiki announcements and site admin list <
> mediawiki-l(a)lists.wikimedia.org>, pywikipedia-l(a)lists.wikimedia.org
> Cc:
> Date: Mon, 6 Aug 2012 16:05:03 +0400
> Subject: [Pywikipedia-l] Automatic generation of templates descriptions
> 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?
>
Hi Yury,
I actually just solved this problem myself. There is indeed a method of
pywikipediabot that does this - it's called templatesWithParams()
Here is a code example where I am looking to get see what the "VIAF"
parameter is of the {{Authority Control}} template:
def determineAuthorityControlTemplate(nameOfPage):
"""returns 'noACtemplate' if no Authority Control Template,
'templateNoVIAF' if AC template but no VIAF number,
and returns the viaf number if it exists"""
namepage = Page(enwp,nameOfPage)
templates = namepage.templatesWithParams() #here we load the templates
into a list
for template in templates: # go through the templates
if template[0] == 'Authority control': # are we looking at the
right template?
for param in template[1]: #go through the paramaters of the
template
if param[:4] == 'VIAF': #are we looking at the right
parameter?
return param[5:]
return 'templateNoVIAF'
return 'noACtemplate'
Best,
Max
>
>
> Sincerely yours,
> -----
> Yury Katkov
>
>
>
> _______________________________________________
> Pywikipedia-l mailing list
> Pywikipedia-l(a)lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
>
>