On Thu, November 20, 2008 8:15 am, Chris Watkins wrote:
Is there a way I can make the bot detect a redirect,
follow it, then add
the category on the new page? Or at least some easier way than looking
each page up separately and adding the category?
wikipedia.py will return a IsRedirectPage exception with the new page
title as exception text. If you catch the exception, read the text (try:
(..) except IsRedirectPage, e: print e.message) and get that page.
For use in category.py you could adapt line 354 and further (except
wikipedia.IsRedirectPage, arg:) to read that page name and act upon it.
Hopefully this answers your question.
Best regards,
Merlijn 'valhallasw' van Deen