2

I have a mediawiki with different type of categories.

If a page has 2 categories

[[Category:Pear]][[Category:Strawberry]]) 

I want to add a third category

[[Category:Fruit_Salad]]

Is it possible to do that automatically? (using a bot for instance)

Edit: In fact, what I need is an API for categories

  1. a way to read the category
  2. a way to add a new category

The rest can be done by any program

2
  • It would require a lot of logic to determine that Pears and Strawberries should yield another categorie of Fruit Salad... Jun 22, 2011 at 3:29
  • @Nick Radford what kind of logic? I have already the list of pairs that I want to edit. I guess I just need to access the categories in the database. I am a total newbie in mediawiki, is there a simple way to access them? Jun 22, 2011 at 3:33

1 Answer 1

3

You are probably looking for the pywikipediabot framework. (Check catlib.py for the category manipulation code, and category.py for an end-user-friendly mass category modification bot.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.