diff --git a/lib/SixteenColors/API/Controller/Docs.pm b/lib/SixteenColors/API/Controller/Docs.pm index fe805aa..95e4e02 100644 --- a/lib/SixteenColors/API/Controller/Docs.pm +++ b/lib/SixteenColors/API/Controller/Docs.pm @@ -3,6 +3,8 @@ package SixteenColors::API::Controller::Docs; use Moose; use namespace::autoclean; +use URI; + BEGIN { extends 'Catalyst::Controller'; } @@ -11,7 +13,7 @@ sub auto : Private { my ( $self, $c ) = @_; $c->stash( - base_url => $c->uri_for( '/' ), + base_url => URI->new( 'http://sixteencolors.net' ), static_url => $c->uri_for( '/static/' ), ); diff --git a/root/api/index.tt b/root/api/index.tt index 49c4351..a8cdd22 100644 --- a/root/api/index.tt +++ b/root/api/index.tt @@ -2,125 +2,9 @@

Developer API

-

We have created a simple API for developers to use Sixteen Colors data within their applications. The data provided by the API will expand as the data contained within the site expands. Currently there are four methods within the API:

-

Years

-

The starting point for Sixteen Colors data is a year. The data that is returned is a simple array of years.

-
http://sixteencolors.net/api/pack
-

Sample data:

-
{ - "years": [ - 2009, - 2008, - 2007, - 2006, - 2005, - 2004, - 2003, - 2002, - 2001, - 2000, - 1999, - 1998, - 1997, - 1996, - 1995, - 1994, - 1993 - ] -}
-

Packs in Year

-
http://sixteencolors.net/api/pack?year=[year]
-

Each pack in the year will be returned. The data for each year is:

-
-
filename
-
The filename of the pack
-
month
-
The month the pack was released. May be null.
-
year
-
The year the pack was released
-
name
-
The canonical name of the pack
-
-

Sample data:

-
{ - "packs": [ - { - "filename": "legion01.zip", - "month": null, - "name": "legion01", - "year": 1998 - }, - { - "filename": "legion02.zip", - "month": null, - "name": "legion02", - "year": 1998 - }, - { - "filename": "legion03.zip", - "month": null, - "name": "legion03", - "year": 1998 - }, - { - "filename": "legion04.zip", - "month": null, - "name": "legion04", - "year": 1998 - } - ] -}
-

Files in Pack and Pack Details

-
http://sixteencolors.net/api/pack/[canonical pack name]
-

Sample data:

-
{ - "pack": { - "pack_file_location": "/static/packs/1998/legion01.zip", - "filename": "legion01.zip", - "files": [ - { - "fullsize": "/pack/legion01/AOH-JAAP.ANS/fullscale", - "thumbnail": "/pack/legion01/AOH-JAAP.ANS/preview", - "filename": "AOH-JAAP.ANS", - "pack": { - "filename": "legion01.zip", - "name": "legion01", - "uri": "/pack/legion01" - }, - "file_location": "/pack/legion01/AOH-JAAP.ANS/download", - "uri": "/pack/legion01/AOH-JAAP.ANS" - }, - { - "fullsize": "/pack/legion01/AOH-JEW.ANS/fullscale", - "thumbnail": "/pack/legion01/AOH-JEW.ANS/preview", - "filename": "AOH-JEW.ANS", - "pack": { - "filename": "legion01.zip", - "name": "legion01", - "uri": "/pack/legion01" - }, - "file_location": "/pack/legion01/AOH-JEW.ANS/download", - "uri": "/pack/legion01/AOH-JEW.ANS" - }, - { - "fullsize": "/pack/legion01/AOH-OOZE.ANS/fullscale", - "thumbnail": "/pack/legion01/AOH-OOZE.ANS/preview", - "filename": "AOH-OOZE.ANS", - "pack": { - "filename": "legion01.zip", - "name": "legion01", - "uri": "/pack/legion01" - }, - "file_location": "/pack/legion01/AOH-OOZE.ANS/download", - "uri": "/pack/legion01/AOH-OOZE.ANS" - }, - ], - "month": null, - "name": "legion01", - "uri": "/pack/legion01", - "year": 1998 - } -}
+
diff --git a/root/pages/api.tt b/root/api/v0.tt similarity index 99% rename from root/pages/api.tt rename to root/api/v0.tt index 49c4351..af0c317 100644 --- a/root/pages/api.tt +++ b/root/api/v0.tt @@ -1,4 +1,4 @@ -[% SET title = 'Developer API' %] +[% SET title = 'API v0' %]

Developer API

diff --git a/root/wrapper.tt b/root/wrapper.tt index f7627a9..967765f 100644 --- a/root/wrapper.tt +++ b/root/wrapper.tt @@ -60,7 +60,7 @@ _gaq.push(['_trackPageview']);