Skip to content

attus74/mediawiki-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MediaWiki API

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages