Griboedow / GoogleKnowledgeGraph

Mediaiwki Extension to get info from Google Knowledge Graph. Developed only for education purposes: it is not suitable for real usage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GoogleKnowledgeGraph MediaWiki extension adds tooltips with short description about specified terms. The description received automatically from Google Knowledge Graph.

Main purpose of the extension is to show on a simple example how to develop MediaWiki extensions, that is why you see quite many comments for each and every method.

There is a Russian article with detailed description of the extension development: https://habr.com/ru/company/veeam/blog/544534/

Warning

The extension is provided only for education purposes. Using it in production is not recommended: Google provides only 100 000 requests for free.

Installation and configuration

To install the extension, place the folder in ./extensions and add in LocalSettings.php:

wfLoadExtension( 'GoogleKnowledgeGraph' );
$wgGoogleApiToken = 'your-google-token';
$wgGoogleApiLanguage = 'en';

Where to get Google API token

You can get token on: https://console.cloud.google.com/flows/enableapi?apiid=kgsearch.googleapis.com&credential=client_key

Usage

To use the extension add on a page tag:

<GoogleKnowledgeGraph query="Mario">

and save the page

You'll get something like that: GKG_sample

About

Mediaiwki Extension to get info from Google Knowledge Graph. Developed only for education purposes: it is not suitable for real usage

License:MIT License


Languages

Language:PHP 87.5%Language:JavaScript 10.9%Language:CSS 1.6%