Hi, I have a problem with MediaWiki API when trying to get links of all files (images, pdfs, etc ..) which are included in given page. With the MW API I can get the all other links but no links to media files.
Ex.: I have a MW with Main Page, which contains following links (all links are working when click on them): .. [[File:Test.txt]]
[[Test Page]]
[[www.google.com]] ..
I use Perl interface to MediaWiki API. Variable $page contents the hash with properties of 'Main Page'. my $query = { action => 'query', prop => 'links', titles => $page->{title}, pllimit => 50, }; my $mw_links = $mediawiki->api($query);
but when I write out the content of $mw_links->{query}->{pages}->{$page->{pageid}}->{links}, I get only the titles of the two following links: Test Page Www.google.com I don't get the name of the link to File:Test.txt.
I tried to play also with the namespaces (option plnamespace, for ex. plnamespace = 6,) but it doesn't show the link neither. I get the same result when I write it directly to the url: http://localhost/mediawiki/api.php?action=query&prop=links&pllimit=5...
Am I missing something? Thank you for response. Pavel Volek