How to get parsed results of templates and modules

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get parsed results of templates and modules

Furkan Gözükara
Hello. I would like to learn if this possible

For example lets say the article gelmek


On that page it has conjugations

When we click edit, we see that it has the following template/module

{{tr-conj|gel|e|gelir|i|d}}

So can i parse this?

Like i provide the page id and this template to get the parsed results via api?

Or any other way?

e.g. <a href="https://en.wiktionary.org/w/api.php?action=query&amp;titles=gelmek&amp;parseTemplate={{tr-conj|gel|e|gelir|i|d}}">https://en.wiktionary.org/w/api.php?action=query&titles=gelmek&parseTemplate={{tr-conj|gel|e|gelir|i|d}}

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: How to get parsed results of templates and modules

Bartosz Dziewoński
If you're looking to convert that to HTML, then yes, there is the
action=parse API. For example:
https://en.wiktionary.org/wiki/Special:ApiSandbox#action=parse&format=json&text={{tr-conj|gel|e|gelir|i|d}}&prop=text

If you want to turn that into machine-readable data, or to extract the
conjugations from other pages, then there is probably no way to do it,
other than implementing it on your own.

--
Bartosz Dziewoński

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: How to get parsed results of templates and modules

Furkan Gözükara
I have found this. Is this the best I can get?

<a href="https://en.wiktionary.org/w/api.php?action=parse&amp;format=xml&amp;text={{tr-conj|gel|e|gelir|i|d}}">https://en.wiktionary.org/w/api.php?action=parse&format=xml&text={{tr-conj|gel|e|gelir|i|d}}  

On Fri, Jan 31, 2020 at 10:45 AM Bartosz Dziewoński <[hidden email]> wrote:
If you're looking to convert that to HTML, then yes, there is the
action=parse API. For example:
https://en.wiktionary.org/wiki/Special:ApiSandbox#action=parse&format=json&text={{tr-conj|gel|e|gelir|i|d}}&prop=text

If you want to turn that into machine-readable data, or to extract the
conjugations from other pages, then there is probably no way to do it,
other than implementing it on your own.

--
Bartosz Dziewoński

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api