Hello,
i'm admin on mediawiki site on my companie's intranet.
I have renamed a lot of pages to integrate them in a new namespace.
As a result i have a lot of links that link to the olds names of the
pages which are became redirect pages.
that's a problem for us and for cosmetic reason i have to update all
this links to link directly on the renamed pages.
I dont have found e pywikipedia script who can do this ?
Search all the links in the wiki and change them if the link point on a
redirect page ?
Thanks for your help
Best regards
Try the following script (I have not tested it yet - I am currently at my work, and I cannot use Pywikipediabot here because of a proxy):
#!/usr/bin/python import wikipedia, solve_disambiguation, pagegenerators mysite = wikipedia.getSite() start = '!' for arg in wikipedia.handleArgs(): if arg.startswith('-start'): start = arg[7:] generator = pagegenerators.AllpagesPageGenerator(start=start,includeredirects='only') bot = solve_disambiguation.DisambiguationRobot(True,[],False,generator,False,False) bot.run()
Save this as file.py, and then run "python file.py -start:!" (without the "s).
2008/3/9, okparanoid okparanoid@free.fr:
Hello,
i'm admin on mediawiki site on my companie's intranet.
I have renamed a lot of pages to integrate them in a new namespace.
As a result i have a lot of links that link to the olds names of the
pages which are became redirect pages.
that's a problem for us and for cosmetic reason i have to update all
this links to link directly on the renamed pages.
I dont have found e pywikipedia script who can do this ?
Search all the links in the wiki and change them if the link point on a
redirect page ?
Thanks for your help
Best regards
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Thanks Andre seems to be in the good way to resolv by problem.
solve_disambiguation.DisambiguationRobot(True,[],False,generator,False,False)
Seems that the script is waiting to have the option that it have to do automatically in place of the first boolean if it is not set to False.
With putting to true this first argument the script raise an exception because i try to read the desired action. With putting to false this first argument the script ask me what to do when he found a link but i don't have found the correct action.
Thanks for your very precious help !
Selon Andre Engels andreengels@gmail.com:
Try the following script (I have not tested it yet - I am currently at my work, and I cannot use Pywikipediabot here because of a proxy):
#!/usr/bin/python import wikipedia, solve_disambiguation, pagegenerators mysite = wikipedia.getSite() start = '!' for arg in wikipedia.handleArgs(): if arg.startswith('-start'): start = arg[7:] generator = pagegenerators.AllpagesPageGenerator(start=start,includeredirects='only') bot = solve_disambiguation.DisambiguationRobot(True,[],False,generator,False,False) bot.run()
Save this as file.py, and then run "python file.py -start:!" (without the "s).
2008/3/9, okparanoid okparanoid@free.fr:
Hello,
i'm admin on mediawiki site on my companie's intranet.
I have renamed a lot of pages to integrate them in a new namespace.
As a result i have a lot of links that link to the olds names of the
pages which are became redirect pages.
that's a problem for us and for cosmetic reason i have to update all
this links to link directly on the renamed pages.
I dont have found e pywikipedia script who can do this ?
Search all the links in the wiki and change them if the link point on a
redirect page ?
Thanks for your help
Best regards
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
-- Andre Engels, andreengels@gmail.com ICQ: 6260644 -- Skype: a_engels
Hello !
I have troubles understand your first mail.
You moved a lot of pages from a namespace to another, i.e. ns1:test to ns2:test
As a result, redirects like ns1:test -> ns2:test got created, and apparently, it bothers you, right ?
What are you trying to do ? Delete all these redirects ? Create some other redirects ? I'm lost. Could you try explaining again what you're trying to do ?
(You might want to contact me in French, for a better understanding of the issue ?!)
A bientot,