Possible duplicate:
How to get all the articles in the Wikipedia section and its subcategories
So, I am doing a PHP project for fun, which involves extracting a random element from a specific category on Wikipedia. For example, say I want a random weapon: my program goes to http://en.wikipedia.org/wiki/ Category: Weapons and selects a subcategory at random (say Category: Toy weapons ), then continues to choose a lower level of subcategory until will not reach an article that is not a category (ex: Super Soaker ).
However, I am having problems getting a list of subcategories from this category. I know that I can get the categories to which the article belongs, but how can I do the opposite (extract pages with a specific category)?
Thank.
source
share