Code Monkey home page Code Monkey logo

query-server's Introduction

Query-Server

Build Status Dependency Status Join the chat at https://gitter.im/fossasia/query-server

The query server can be used to search a keyword/phrase on a search engine (Google, Yahoo, Bing, DuckDuckGo) and get the results as json or xml. The tool also stores the searched query string in a MongoDB database for analytical purposes. (The search engine scrapper is based on the scraper at fossasia/searss.)

Deploy

Table of Contents

API

The API(s) provided by query-server are as follows:

GET /api/v1/search/<search-engine>?query=query&format=format

search-engine : ['google' , 'bing', 'duckduckgo' , 'yahoo']

query : query can be any string

format : [ json, xml ]

A sample query : /api/v1/search/bing?query=fossasia&format=xml

Error Codes

404 Not Found : Incorrect Search Engine, Zero Response
400 Bad Request : query and/or format is not in the correct format

Dependencies

Installation

Make sure you have Nodejs installed. Running this tool requires installing the nodejs as well as python dependencies.

git clone https://github.com/fossasia/query-server.git 
cd query-server
npm install -g bower
bower install
pip install -r requirements.txt

To set up MongoDB on your server :

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo service mongod start

Usage

To run the query server:

python app/server.py

Contribute

Found an issue? Post it in the issue tracker

License

This project is currently licensed under the Apache License version 2.0. A copy of LICENSE should be present along with the source code. To obtain the software under a different license, please contact FOSSASIA.

query-server's People

Contributors

afrozas avatar mariobehling avatar niranjan94 avatar nikhilkumarsingh avatar abhishek1995s avatar alejoheredia avatar djmgit avatar devanshg27 avatar fazeem84 avatar kalbhor avatar niccokunzmann avatar nikhilrayaprolu avatar rhemon avatar gitter-badger avatar imujjwal96 avatar

Watchers

 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.