Il 25/10/2014 10:40 UTC, Harald Groven ha scritto:
How do I get a parameter of pages using a template using the API?
E.g. extract 12345 from pages tagged with {{mytemplate|12345}}, when
mytemplate do not contain categories.

--
Harald Groven
AFAIK, there is no way to get such information with the core API modules without directly adding categories via templates. But if the target wiki uses Parsoid <https://www.mediawiki.org/wiki/Parsoid>, you may use its API to obtain RDFa data (combined with HTML5 content) also containing transclusions in a machine-readable format. The specification <https://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Transclusion_content> is available. Another approach could be the great mwparserfromhell <https://github.com/earwig/mwparserfromhell> Python library, widely used by bots for advanced wikitext parsing.
Please let us know your choice.
_______________________________________________
Mediawiki-api mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

Reply via email to