Code Monkey home page Code Monkey logo

wiqi's Introduction

Wiqi - (Wi)kipedia API (Q)uery (I)nterface

About

This project is a Wikipedia API Query Interface for Laravel 5. A simple interface for performing "action=query" requests to the Wikipedia API.

Installation

Add to your composer.json:

{
    "require": {
        "likey/wiqi": "dev-master"
    }
}

or from command line:

composer require likey/wiqi

Your /config/app.php Add the service provider:

    Likey\Wiqi\WiqiServiceProvider::class,

Example:

'providers' => [
    Likey\Wiqi\WiqiServiceProvider::class,
],

Add the facade:

    'Wiqi'      => Likey\Wiqi\Facades\Wiqi::class,

Example:

'aliases' => [
    'Wiqi'      => Likey\Wiqi\Facades\Wiqi::class,
]

Usage

May change since in-dev.

get() - Return Array of Query Result:

$wiqiResults = Wiqi::query("like")->get();
print_r($wiqiResults);

count(int) - More Pages in Results:

$wiqiResults = Wiqi::query("like")->count(5)->get();
print_r($wiqiResults);

brief() - Add First Sentance and Image to Results:

$wiqiResults = Wiqi::query("like")->brief()->count(5)->get();
print_r($wiqiResults);

Example return:

[
{
"pageid": 567140,
"title": "Like",
"extract": "In the English language, the word like has a very flexible range of uses, ranging from conventional to non-standard."
},
{
"pageid": 1215338,
"title": "Like a Rolling Stone",
"extract": "\"Like a Rolling Stone\" is a 1965 song by the American singer-songwriter Bob Dylan.",
"image": "https://upload.wikimedia.org/wikipedia/en/1/1e/Bob_Dylan_-_Like_a_Rolling_Stone.jpg"
},
{
"pageid": 167924,
"title": "Like Mike",
"extract": "Like Mike is a 2002 American comedy film directed by John Schultz and written by Michael Elliot and Jordan Moffet.",
"image": "https://upload.wikimedia.org/wikipedia/en/e/ee/Like_Mike_poster.jpg"
},
{
"pageid": 28504903,
"title": "Like a G6",
"extract": "\"Like a G6\" is a 2010 song written and performed by Far East Movement, The Cataracs, and Dev, with the latter two being credited as featured artists.",
"image": "https://upload.wikimedia.org/wikipedia/en/5/59/Like_a_G6_single_cover.jpg"
},
{
"pageid": 9737001,
"title": "Like Sonny",
"extract": "Like Sonny is a compilation album combining two sessions from 1958 and 1960 with jazz musician John Coltrane.",
"image": "https://upload.wikimedia.org/wikipedia/en/f/fd/Like_Sonny.jpeg"
}
]

License

Copyright 2015 Likey, LLC.

wiqi's People

Contributors

kealjones avatar

Stargazers

Karl avatar

Watchers

James Cloos avatar  avatar  avatar Karl avatar  avatar Jose Cardenas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.