Giter Site home page Giter Site logo

ramzallan / quotefaultapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from computersciencehouse/quotefaultapi

0.0 2.0 0.0 104 KB

A RESTful API for interacting with CSH Quotefault, no webgui required!

Home Page: https://quotefault-api.csh.rit.edu/

License: GNU General Public License v3.0

Python 100.00%

quotefaultapi's Introduction

Quotefault API

Python 3.6 Travis

A RESTful API for interacting with CSH Quotefault, no webgui required!

Format

{
  "533": {
    "quote": "I can't wait to get to New York and kill everyone", 
    "quoteTime": "Fri, 27 Oct 2017 22:14:31 GMT", 
    "speaker": "Tanat", 
    "submitter": "matted"
  }
}

All date paramaters use the format mm-dd-yyyy.

If no quotes are found, all routes return 'none'.

/<api_key>/all : GET

Allowed Parameters: date, submitter, speaker

Example Request: ``

/<api_key>/random : GET

Allowed Parameters: date, submitter, speaker

Example Request: /random?submitter=dante

/<api_key>/newest : GET

Allowed Parameters: date, submitter, speaker

Example Request: /<api_key>/newest?submitter=matted

Output:

Returns the newest result from the submitter = matted

{
  "533": {
    "quote": "I can't wait to get to New York and kill everyone", 
    "quoteTime": "Fri, 27 Oct 2017 22:14:31 GMT", 
    "speaker": "Tanat", 
    "submitter": "matted"
  }
}

/<api_key>/between/<start>/<limit> : GET

Allowed Parameters: submitter, speaker Required Parameters: start, limit

Route produces a list of quotes between the two dates.

/<api_key>/<qid> : GET

Returns the specified quote. Ignores query parameters.

/<api_key>/create : PUT

Required Parameters: JSON Object

{
    "quote": "This is an example Quote",
    "submitter": "matted",
    "speaker": "Example Speaker"
}

/generatekey/<reason> : GET

Requires a reason as to the use of the API key. A key has a unique owner/reason pair.

Output:

91651at924r55egdfac5

Dev Setup

This project is built in Python 3, and all of its dependencies are accesible via pip.

Installing Python

This guide should cover installing python then you need to make sure you have pip installed.

Recommended setup

From inside your repository directory run

python3 -m virtualenv venv # Sets up virtualenve in the venv directory in your working directory
source venv/bin/activate # Activates the virtual environment
pip install -r requirements.txt # Installs all of the dependencies listed in the requirements to the virtualenv

At this point all the dependencies are installed, so copy config.env.py to config.py and fill in fields. You probably need to set SERVER_NAME = 127.0.0.1:5000, which is where flask will put local applications.

All that's left is running it with flask run. Flask should automatically find app.py, though you may want to set debug mode with export FLASK_ENV=development before you run it.

quotefaultapi's People

Contributors

ag-ayush avatar crigney3 avatar devinmatte avatar multiojuice avatar mxmeinhold avatar stevenmirabito avatar wgahnagl avatar

Watchers

 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.