A RESTful API for interacting with CSH Quotefault, no webgui required!
{
"id": "533",
"quote": "I can't wait to get to New York and kill everyone",
"submitter": "matted",
"speaker": "Tanat",
"quoteTime": "Fri, 27 Oct 2017 22:14:31 GMT"
}
All date
parameters should use the format yyyymmdd
. The format mm-dd-yyyy
is deprecated.
If no quotes are found, all routes return 'none'.
Allowed Parameters: date
, submitter
, speaker
Example Request: ``
Allowed Parameters: date
, submitter
, speaker
Example Request: /random?submitter=dante
Allowed Parameters: date
, submitter
, speaker
Returns the newest result from the submitter = matted
{
"id": "533",
"quote": "I can't wait to get to New York and kill everyone",
"submitter": "matted",
"speaker": "Tanat",
"quoteTime": "Fri, 27 Oct 2017 22:14:31 GMT"
}
Allowed Parameters: submitter
, speaker
Required Parameters: start
, limit
Route produces a list of quotes between the two dates.
Returns the specified quote. Ignores query parameters.
Required Parameters: JSON Object
{
"quote": "This is an example Quote",
"submitter": "matted",
"speaker": "Example Speaker"
}
Optionally takes speaker and or submitter query string parameters.
Generates a quote using a Markov chain based on all quotes, optionally filted by speaker or submitter.
Optionally takes speaker and or submitter query string parameters.
Generates a list of quotes (length = count) using a Markov chain based on all quotes, optionally filted by speaker or submitter.
Requires a reason as to the use of the API key. A key has a unique owner/reason pair.
91651at924r55egdfac5
This project is built in Python 3, and all of its dependencies are accesible via pip.
This guide should cover installing python then you need to make sure you have pip installed.
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.