Hi folks,
I'm currently pushing my company to adopt mediawiki as our main collaborative working tool. I'm looking for a way to automaticaly create an article containing a list of permanent links pointing to specific versions of articles. It could be a category but this category should be "frozen"; the category should list the articles versions frozen at time T.
In short, I'm trying to "tag" (as in cvs or subversion) a list of articles.
Is it feasible with mediawiki? Maybe using some Bots?
Thanks,
Fred
fred wrote:
I'm currently pushing my company to adopt mediawiki as our main collaborative working tool. I'm looking for a way to automaticaly create an article containing a list of permanent links pointing to specific versions of articles. It could be a category but this category should be "frozen"; the category should list the articles versions frozen at time T.
In short, I'm trying to "tag" (as in cvs or subversion) a list of articles.
Is it feasible with mediawiki? Maybe using some Bots?
If you're in the database, you can get the current revision number of each page from its page_latest field. You can then make a list of links using the 'oldid' URL parameter, and store it however you like.
-- brion vibber (brion @ pobox.com)
Moin,
On Wednesday 26 April 2006 23:46, Brion Vibber wrote:
fred wrote:
I'm currently pushing my company to adopt mediawiki as our main collaborative working tool. I'm looking for a way to automaticaly create an article containing a list of permanent links pointing to specific versions of articles. It could be a category but this category should be "frozen"; the category should list the articles versions frozen at time T.
In short, I'm trying to "tag" (as in cvs or subversion) a list of articles.
Is it feasible with mediawiki? Maybe using some Bots?
If you're in the database, you can get the current revision number of each page from its page_latest field. You can then make a list of links using the 'oldid' URL parameter, and store it however you like.
And the best way would probably to write a new SpecialPage, call it SpecialFreezeList or something.
User could then select which articles need "freezing" and where to store the list linking to these revisions.
best wishes,
Tels
Le Mercredi 26 Avril 2006 23:56, Tels a écrit :
Moin,
On Wednesday 26 April 2006 23:46, Brion Vibber wrote:
fred wrote:
I'm currently pushing my company to adopt mediawiki as our main collaborative working tool. I'm looking for a way to automaticaly create an article containing a list of permanent links pointing to specific versions of articles. It could be a category but this category should be "frozen"; the category should list the articles versions frozen at time T.
In short, I'm trying to "tag" (as in cvs or subversion) a list of articles.
Is it feasible with mediawiki? Maybe using some Bots?
If you're in the database, you can get the current revision number of each page from its page_latest field. You can then make a list of links using the 'oldid' URL parameter, and store it however you like.
And the best way would probably to write a new SpecialPage, call it SpecialFreezeList or something.
User could then select which articles need "freezing" and where to store the list linking to these revisions.
Thanks you very much for your answers/suggestions. I've been scratching my head about this problem since yesterday.
The problem is that if I freeze an article, I WON'T freeze children articles whose link is mentionned in the frozen article...Anoying...
If think the best way to go is to tag my whole mediawiki website using subversion each time I wan't to freeze it.
Then if I want to go back, I restore the whole site... no other satisfying solutions for the moment.
My only wish left is to create a bot that would fill the summary of a list of article with something like "VERSION 1.0".
Is this a difficult bot to write ? Any rough example around ?
sheers
Fred
Le Jeudi 27 Avril 2006 22:04, fred a écrit :
Le Mercredi 26 Avril 2006 23:56, Tels a écrit :
Moin,
On Wednesday 26 April 2006 23:46, Brion Vibber wrote:
fred wrote:
I'm currently pushing my company to adopt mediawiki as our main collaborative working tool. I'm looking for a way to automaticaly create an article containing a list of permanent links pointing to specific versions of articles. It could be a category but this category should be "frozen"; the category should list the articles versions frozen at time T.
In short, I'm trying to "tag" (as in cvs or subversion) a list of articles.
Is it feasible with mediawiki? Maybe using some Bots?
If you're in the database, you can get the current revision number of each page from its page_latest field. You can then make a list of links using the 'oldid' URL parameter, and store it however you like.
And the best way would probably to write a new SpecialPage, call it SpecialFreezeList or something.
User could then select which articles need "freezing" and where to store the list linking to these revisions.
Thanks you very much for your answers/suggestions. I've been scratching my head about this problem since yesterday.
The problem is that if I freeze an article, I WON'T freeze children articles whose link is mentionned in the frozen article...Anoying...
If think the best way to go is to tag my whole mediawiki website using subversion each time I wan't to freeze it.
Then if I want to go back, I restore the whole site... no other satisfying solutions for the moment.
My only wish left is to create a bot that would fill the summary of a list of article with something like "VERSION 1.0".
Is this a difficult bot to write ? Any rough example around ?
I reply to myself.
I've found this good template : http://cvs.sourceforge.net/viewcvs.py/*checkout*/pywikipediabot/pywikipedia/...
So I've amended it a bit to make it works as I want :
<code> #!/usr/bin/python # -*- coding: utf-8 -*-
""" This bot goes over multiple pages of the home wiki, and tag them without changing. Tagging means that a summary is simply assigned to the current version of the article, just as a tag.
This script understands various command-line arguments:
-start: used as -start:page_name, specifies that the robot should go alphabetically through all pages on the home wiki, starting at the named page.
-file: used as -file:file_name, read a list of pages to treat from the named textfile. Page titles should be enclosed in [[double-squared brackets]].
-ref: used as -start:page_name, specifies that the robot should touch all pages referring to the named page.
-links: used as -links:page_name, specifies that the robot should touch all pages referred to from the named page.
-cat: used as -cat:category_name, specifies that the robot should touch all pages in the named category.
-redir specifies that the robot should touch redirect pages; otherwise, they will be skipped.
-tag: specifies the text of the tag. Example -tag:VERSION1.0
All other parameters will be regarded as a page title; in this case, the bot will only touch a single page. """
import wikipedia, pagegenerators, catlib import sys
class Tag: def __init__(self, generator, touch_redirects): self.generator = generator self.touch_redirects = touch_redirects
def run(self): for page in self.generator: try: text = page.get(get_redirect=self.touch_redirects) page.put(text) except wikipedia.NoPage: print "Page %s does not exist?!" % page.aslink() except wikipedia.IsRedirectPage: print "Page %s is a redirect; skipping." % page.aslink() except wikipedia.LockedPage: print "Page %s is locked?!" % page.aslink()
def main(): #page generator gen = None redirs = False pageTitle = [] for arg in wikipedia.handleArgs(): if arg.startswith('-start:'): gen = pagegenerators.AllpagesPageGenerator(arg[7:]) elif arg.startswith('-ref:'): referredPage = wikipedia.Page(wikipedia.getSite(), arg[5:]) gen = pagegenerators.ReferringPageGenerator(referredPage) elif arg.startswith('-links:'): linkingPage = wikipedia.Page(wikipedia.getSite(), arg[7:]) gen = pagegenerators.LinkedPageGenerator(linkingPage) elif arg.startswith('-file:'): gen = pagegenerators.TextfilePageGenerator(arg[6:]) elif arg.startswith('-cat:'): cat = catlib.Category(wikipedia.getSite(), arg[5:]) gen = pagegenerators.CategorizedPageGenerator(cat) elif arg == '-redir': redirs = True elif arg == '-tag:': summary_message = arg[5:] else: pageTitle.append(arg)
if pageTitle: page = wikipedia.Page(wikipedia.getSite(), ' '.join(pageTitle)) gen = iter([page]) if not gen: wikipedia.showHelp('touch') else: preloadingGen = pagegenerators.PreloadingGenerator(gen) bot = Tag(preloadingGen, redirs) wikipedia.setAction(summary_message) bot.run()
if __name__ == "__main__": try: main() finally: wikipedia.stopme() </code>
Basically I've just added the "wikipedia.setAction(summary_message)" command, is it correct ? I'm a bit afraid to make it run on my wikipedia as it is the very first time I run bots on it.
thanks
Fred
Le Jeudi 27 Avril 2006 22:56, Elliott F. Cable a écrit :
I'm a bit afraid to make it run on my wikipedia as it is the...
*Wiki. Not wikipedia. Wikipedia is a site. You don't have 'a wikipedia'. You have 'a wiki'. More specifically, 'a wiki running on MediaWiki'.
Yes sorry. It's a bit late here in Belgium ;-)
Sorry, just a pet peeve of mine (-:
People calling 'pages on wikipedia' 'wikis', and people calling their wiki site 'a wikipedia about XXXXX' and stuff like that... wikipedia isn't the only wiki. wikipedia isn't the best run wiki. wikipedia wasn't the first wiki. wikipedia isn't ANYTHING but the largest wiki... oh well sorry, [/rant]. On Apr 27, 2006, at 1:00 PM, fred wrote:
Le Jeudi 27 Avril 2006 22:56, Elliott F. Cable a écrit :
I'm a bit afraid to make it run on my wikipedia as it is the...
*Wiki. Not wikipedia. Wikipedia is a site. You don't have 'a wikipedia'. You have 'a wiki'. More specifically, 'a wiki running on MediaWiki'.
Yes sorry. It's a bit late here in Belgium ;-) _______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org