Code Monkey home page Code Monkey logo

wikimedia-content-adapter's Introduction

Travis Status Docker Build Statu

wikimedia-content-adapter

This repository contains a service adapter for querying the Wikimedia API. The service provides the Schul-Cloud Search API interface.

Get started

After clone this repo go inside the directory and run :

npm install

To start the service on default configurations run:

npm start

The Service will listen on localhost:8080.

If you want to run it under an other port/address run:

nodejs app.js -address address-to-listen-on -port port-to-listen-on

When running without params port or address will be default

Code Example

 your.domain/v1?Q=search-value&page[limit]=12&filter[license]=pd

API Reference

Query params:

  • Q = query value for searching.
  • page[limit] = max number of result elements.
  • page[offset] = offset of the result elements.
  • filer[filterKey] = filter for the result. The filterKey must be an key of the result object.

Docker

You can install docker.

wget -O- https://get.docker.com | sh
sudo usermod -aG docker $USER

To enable that you do not need sudo to run the docker containers, log in and out.

Once you installed docker, you can create a new schulcloud/wikimedia-content-adapter container like this:

docker build -t schulcloud/wikimedia-content-adapter .

Then, you can run the container and map the http port to port 8000 (you can change this port as you wish).

docker run --rm -p 8000:8080 schulcloud/wikimedia-content-adapter

Now, you should be able to request a search:

curl -i 'http://localhost:8000/v1?Q=einstein'

License

                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

wikimedia-content-adapter's People

Contributors

niccokunzmann avatar kremer-io avatar szymczakk avatar mattmattv avatar suknuk avatar

Watchers

James Cloos avatar  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.