Please don't submit pull requests or patches here
Go to file
Christine Dodrill c7af9e9bb2 Tests: be less verbose 2015-08-13 21:18:36 -07:00
client Tests: be less verbose 2015-08-13 21:18:36 -07:00
public/static static -> public, use bash 2015-08-13 21:09:02 -07:00
.dockerignore Initial commit 2015-08-09 12:51:43 -07:00
.gitattributes update gitattributes 2015-08-13 21:10:34 -07:00
.gitignore start nim rewrite 2015-08-13 19:20:23 -07:00
Dockerfile static -> public, use bash 2015-08-13 21:09:02 -07:00
LICENSE Initial commit 2015-08-09 12:51:43 -07:00
Makefile Serve /all 2015-08-13 19:47:00 -07:00
README.md update readme 2015-08-12 18:17:05 -07:00
fim.list again update episode list 2015-08-11 13:22:27 -07:00
ponyapi.nim Send 406 on no search query 2015-08-13 20:56:02 -07:00
ponyapi.nimble implement remaining API calls 2015-08-13 20:51:03 -07:00
requirements.txt Initial commit 2015-08-09 12:51:43 -07:00

README.md

PonyAPI

A simple API for episodes of My Little Pony: Friendship is Magic to be run inside a container.

API Usage

An episode will have the following data type:

{
      "air_date": 1286735400,
      "episode": 1,
      "is_movie": false,
      "name": "Friendship is Magic Part 1",
      "season": 1
}

This represents Season 1, Episode 1 of My Little Pony: Friendship Is Magic. The air_date column represents the date and time that the episode was originally shown on The Hub (now Discovery Family Network). If is_movie is set and the season number is 99, the episode record should be treated as a movie.

Usage Limits

None. Don't make the server it's running on crash and we'll all be good.

Clients

Routes

The canonical route base for PonyAPI is http://ponyapi.apps.xeserv.us. Example usage:

$ curl http://ponyapi.apps.xeserv.us/season/1/episode/1
{
  "episode": {
    "air_date": 1286735400,
    "episode": 1,
    "is_movie": false,
    "name": "Friendship is Magic Part 1",
    "season": 1
  }
}

/all

Returns all information about all episodes. This returns an array of Episode objects as defined above.

/newest

Returns the episode of My Little Pony: Friendship is Magic that will air next.

/season/<number>

Returns all information about episodes in the given season number or a 404 reply if no episodes could be found. To get all information about the movies shown, set the season as 99.

/season/<number>/episode/<number

Returns all information about the episode with the given season and episode number. If the episode cannot be found, this will return a 404.

/random

Returns a random episode record from the list of episodes.

This must be given a query paramater q containing the text to search for. Not including this will return a 406 reply. This will search the list of episode records for any episodes whose names match the given search terms. This is case-insensitive. If no episodes can be found, this will return a 404 reply.