How do you grab an article, including links in an easy-to-use format?

I have an internal mediawiki deployment. Some articles have external links. I have another page that calls API calls for a wiki to pull articles to another site. When I pull out these articles, the links are not pulled properly. Here is an example.

Wiki article:

Use [http://example.com THIS LINK] to contact the vendor.

API URL:

https://mysite.com/mediawiki/api.php?action=query&format=json&prop=extracts&titles=Vendor

API Results:

Use THIS LINK to contact the vendor.

Please note that the link has been completely removed. I also tried adding my own html to the mediawiki for links, but the mediawiki escapes <and> characters, and so the API see "& lt" and "& gt". Also mediawiki displays html, not the actual link.

How do I create MediaWiki API calls and save link information?

+2
source share
1 answer

You can use action=parse . The request will look like this:

 https://mysite.com/mediawiki/api.php?action=parse&format=json&page=Vendor&prop=text 
+2
source

Source: https://habr.com/ru/post/1494441/


All Articles