Skip to content

S2606/query-server

 
 

Repository files navigation

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 to Docker Cloud 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, ask, bing, duckduckgo, yahoo]

query : query can be any string

format : [json, xml]

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

Error Codes

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

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 For pull requests please read Open Source Developer Guide and Best Practices at FOSSASIA

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.

About

Query Server Search Engines https://query-server.herokuapp.com

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • HTML 47.6%
  • Python 43.8%
  • CSS 8.6%