Skip to content

Commit

Permalink
more doc work
Browse files Browse the repository at this point in the history
  • Loading branch information
bricas committed Dec 8, 2011
1 parent 1995eda commit bcc50da
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 122 deletions.
4 changes: 3 additions & 1 deletion lib/SixteenColors/API/Controller/Docs.pm
Expand Up @@ -3,6 +3,8 @@ package SixteenColors::API::Controller::Docs;
use Moose;
use namespace::autoclean;

use URI;

BEGIN {
extends 'Catalyst::Controller';
}
Expand All @@ -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/' ),
);

Expand Down
122 changes: 3 additions & 119 deletions root/api/index.tt
Expand Up @@ -2,125 +2,9 @@
<section id=page class=container>
<div class=grid_12>
<h2 class=style_2>Developer API<span></span></h2>
<p>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:</p>
<h3>Years</h3>
<p>The starting point for Sixteen Colors data is a year. The data that is returned is a simple array of years.</p>
<blockquote class="code">http://sixteencolors.net/api/pack</blockquote>
<h4>Sample data:</h4>
<blockquote class="code">{
"years": [
2009,
2008,
2007,
2006,
2005,
2004,
2003,
2002,
2001,
2000,
1999,
1998,
1997,
1996,
1995,
1994,
1993
]
}</blockquote>
<h3>Packs in Year</h3>
<blockquote class="code">http://sixteencolors.net/api/pack?year=[year]</blockquote>
<p>Each pack in the year will be returned. The data for each year is:</p>
<dl>
<dt>filename</dt>
<dd>The filename of the pack</dd>
<dt>month</dt>
<dd>The month the pack was released. May be null.</dd>
<dt>year</dt>
<dd>The year the pack was released</dd>
<dt>name</dt>
<dd>The canonical name of the pack</dd>
</dl>
<h4>Sample data:</h4>
<blockquote class="code">{
"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
}
]
}</blockquote>
<h3>Files in Pack and Pack Details</h3>
<blockquote class="code">http://sixteencolors.net/api/pack/[canonical pack name]</blockquote>
<h4>Sample data:</h4>
<blockquote class="code">{
"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
}
}</blockquote>
<ul>
<li><a href="/docs/v0">API v0</a></li>
</ul>
</div>
<div class=clear></div>
</section>
2 changes: 1 addition & 1 deletion root/pages/api.tt → root/api/v0.tt
@@ -1,4 +1,4 @@
[% SET title = 'Developer API' %]
[% SET title = 'API v0' %]
<section id=page class=container>
<div class=grid_12>
<h2 class=style_2>Developer API<span></span></h2>
Expand Down
2 changes: 1 addition & 1 deletion root/wrapper.tt
Expand Up @@ -60,7 +60,7 @@ _gaq.push(['_trackPageview']);
<ul>
<li><a href="[% base_url %]contact">Contact</a></li>
<li><a href="[% base_url %]stats">Statistics</a></li>
<li><a href="[% base_url %]api">API</a></li>
<li><a href="http://api.sixteencolors.net">API</a></li>
<li><a href="[% base_url %]colophon">Colophon</a></li>
</ul>
</li>
Expand Down

0 comments on commit bcc50da

Please sign in to comment.