Is there a way (ex: API - params) to get the main article for a category on wikipedia.
For example, The Category page http://en.wikipedia.org/wiki/Category:Cricket has content "The main article for this categoryhttp://en.wikipedia.org/wiki/Help:Categoriesis *Cricket http://en.wikipedia.org/wiki/Cricket*."
I need to retrieve the article *Cricket. * In the above example, It is just a co-incidence that the category name and the article name are the same.
I looked through the API (http://en.wikipedia.org/w/api.php) but didnt find anything relevant. Am I missing something?
Thanks and Regards, Pavan Kapanipathi
On Thu, Jun 20, 2013 at 4:38 PM, Pavan Kapanipathi pavan@knoesis.org wrote:
Is there a way (ex: API - params) to get the main article for a category on wikipedia.
Not really, MediaWiki doesn't have a concept of a "main" article for a category.
The example you note is just in the category page text, you'd have to parse that out somehow. I've also seen the main article sometimes be listed in the category with a sortkey of " "; again, this is something done by editors on the wiki and not a feature of MediaWiki itself.
It looks like that is just a template on the category page: {{Cat main|Cricket}} which is described here: http://en.wikipedia.org/wiki/Template:Cat_main
So it's just text on the page, not part of any database structure. In other words, it's part of wikipedia's particular content/structure -- not mediawiki -- so it's not going to be in the API. The primary data structure for mediawiki is… unstructured text, which makes things like this a bit of a challenge. :) You could pull the contents of the page: http://en.wikipedia.org/wiki/Category:Cricket?action=raw and look for {{Cat
On Jun 20, 2013, at 1:38 PM, Pavan Kapanipathi pavan@knoesis.org wrote:
Is there a way (ex: API - params) to get the main article for a category on wikipedia.
For example, The Category page http://en.wikipedia.org/wiki/Category:Cricket has content "The main article for this category is Cricket."
I need to retrieve the article Cricket. In the above example, It is just a co-incidence that the category name and the article name are the same.
I looked through the API (http://en.wikipedia.org/w/api.php) but didnt find anything relevant. Am I missing something?
Thanks and Regards, Pavan Kapanipathi _______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Thanks Brad and Owen
On Thu, Jun 20, 2013 at 4:50 PM, Owen Davis owen@wikia-inc.com wrote:
It looks like that is just a template on the category page: {{Cat main|Cricket}} which is described here: http://en.wikipedia.org/wiki/Template:Cat_main
So it's just text on the page, not part of any database structure. In other words, it's part of wikipedia's particular content/structure -- not mediawiki -- so it's not going to be in the API. The primary data structure for mediawiki is… unstructured text, which makes things like this a bit of a challenge. :) You could pull the contents of the page: http://en.wikipedia.org/wiki/Category:Cricket?action=raw and look for {{Cat
On Jun 20, 2013, at 1:38 PM, Pavan Kapanipathi pavan@knoesis.org wrote:
Is there a way (ex: API - params) to get the main article for a category on wikipedia.
For example, The Category page http://en.wikipedia.org/wiki/Category:Cricket has content "The main article for this categoryhttp://en.wikipedia.org/wiki/Help:Categoriesis *Cricket http://en.wikipedia.org/wiki/Cricket*."
I need to retrieve the article *Cricket. * In the above example, It is just a co-incidence that the category name and the article name are the same.
I looked through the API (http://en.wikipedia.org/w/api.php) but didnt find anything relevant. Am I missing something?
Thanks and Regards, Pavan Kapanipathi _______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
mediawiki-api@lists.wikimedia.org