attus / mediawikiapi
This package is abandoned and no longer maintained.
No replacement package was suggested.
A basic PHP MediaWiki API
2.1.0
2021-04-12 17:38 UTC
Requires
- guzzlehttp/guzzle: ^6.5
This package is auto-updated.
Last update: 2024-06-26 10:08:13 UTC
README
A basic PHP MediaWiki API to get pages and files
Get page content or URL:
$api = new Api('https://de.wikipedia.org'); $page = $api->getPage('Geschichte der Kölner Straßenbahn'); $content = $page->getContent(); $url = $page->getUrl();
Get image user and page url:
$api = new Api('https://de.wikipedia.org'); $image = $api->getImage('File:KVB4076_Severinsbruecke.jpg'); $pageUrl = $image->getPageUrl(); $user = $image->getImageUser();
Get image URL in a certain size:
$api = new Api('https://de.wikipedia.org'); $image = $api->getImage('File:KVB4076_Severinsbruecke.jpg'); $url = $image->getImageUrl(1920);
If the original image is smaller than the requested size, the URL of the original is returned.