thewulf7/yii2-wikipedia

There is no license information available for the latest version (v1.0) of this package.

Yii component to connect with Wikipedia

v1.0 2016-03-12 06:38 UTC

This package is not auto-updated.

Last update: 2024-05-17 16:22:54 UTC


README

Installation

Begin by installing this package through Composer.

{
    "require": {
        "thewulf7/wikipedia": "dev-master"
    }
}
    'components' => [
        ...
        'wikipedia' => [
            'class' => 'thewulf7\Wikipedia\Connection'
        ]
        ...
    ]

Usage

Retrieve page extract

$wiki = \Yii::$app->get('wikipedia');
    
return $wiki->createCommand()->search('Rome')->getSentences(5);

Same with QueryBuilder

$query = new \thewulf7\Wikipedia\Query();

$query
    ->titles('Rome');

return $query
    ->createCommand()
    ->getSentences(5);