Skip to content

Commit

Permalink
documentation for GET
Browse files Browse the repository at this point in the history
  • Loading branch information
danieltanfh95 committed Oct 1, 2015
1 parent 6336d9f commit 35330e9
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 15 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@ Welcome to the new **REST API**
centre. I'm planning to cleanup the current API provided by mediawiki
so that there would be a unified API for accessing Baka Tsuki data.

The API is aiming for full coverage of the listed novels (as of 2015/10/1).

###Version History

1. 2015/10/1 : Version 1.0 is released.

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/Shadowys/btapi/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

2 changes: 1 addition & 1 deletion public/category.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"></head><body><nav style="height:50px;" class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="#" class="navbar-brand">Home</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="https://github.com/Shadowys/btapi" data-toggle="tooltip" data-placement="right" title="" data-original-title="Source code here!"><i class="fa fa-github fa-2x"> </i></a></li><li><a href="https://www.baka-tsuki.org/forums/viewtopic.php?f=84&amp;t=10959" data-toggle="tooltip" data-placement="right" title="" data-original-title="Share your thoughts"><i class="fa fa-commenting fa-2x"> </i></a></li></ul><ul class="nav navbar-nav navbar-right"><li><a href="#">Top</a></li></ul></div></div></nav><div id="toc"><p>Table of Contents</p><ul><li> <a href="#TLS">Type and Language Search</a></li><li><a href="#Example_Type">JSON example for type parameter only</a></li><li><a href="#Example_Language">JSON example for language parameter only</a></li><li><a href="#Example_Both">JSON example for type and langauge parameter</a></li></ul></div><div id="TLS"><h3>Type and Language Search</h3><h5>route: "/api/category"</h5><h5>return: JSON</h5><h5>format: /api/category?[type={type_of_title}][language={type_of_language}]</h5><br><h4> <u>Filter Parameters</u></h4><h5>By type (Optional)</h5><a href="/api/category?type=LIGHT_NOVEL">/api/category?type=LIGHT_NOVEL</a><p>
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"></head><body><nav style="height:50px;" class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="#" class="navbar-brand">Home</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="https://github.com/Shadowys/btapi" data-toggle="tooltip" data-placement="right" title="" data-original-title="Source code here!"><i class="fa fa-github fa-2x"> </i></a></li><li><a href="https://www.baka-tsuki.org/forums/viewtopic.php?f=84&amp;t=10959" data-toggle="tooltip" data-placement="right" title="" data-original-title="Share your thoughts"><i class="fa fa-commenting fa-2x"> </i></a></li></ul><ul class="nav navbar-nav navbar-right"><li><a href="#">Top</a></li></ul></div></div></nav><div id="toc"><p>Table of Contents</p><ul><li> <a href="#TLS">Type and Language Search</a></li><li><a href="#Example_Type">JSON example for type parameter only</a></li><li><a href="#Example_Language">JSON example for language parameter only</a></li><li><a href="#Example_Both">JSON example for type and langauge parameter</a></li></ul></div><div id="TLS"><h3>Type and Language Search</h3><h5>route: GET "/api/category"</h5><h5>return: JSON</h5><h5>format: /api/category?[type={type_of_title}][language={type_of_language}]</h5><br><h4> <u>Filter Parameters</u></h4><h5>By type (Optional)</h5><a href="/api/category?type=LIGHT_NOVEL">/api/category?type=LIGHT_NOVEL</a><p>
Either parameter may be present. Current available types includes: <b>LIGHT_NOVEL, TEASER, ORIGINAL_NOVEL. </b>It is <b>case insensitive.</b></p><h5>By language (Optional)</h5><a href="/api/category?type=ENGLISH">/api/category?language=ENGLISH</a><p>
Either parameter may be present. Language must be given in it's english name.<b>english name. </b>It is <b>case insensitive.</b></p><br><h4> <u>JSON properties</u></h4><p>There are different responses for different parameter combinations.</p><div id="Example_Type" class="row"><div class="col-md-7"> <h5>Type</h5><p>(JSON) Shows the language available for that particular type.</p><ul> <li> <h5>type</h5><p>
(STRING) type of title, e.g. <b>Light_novel, teaser, Original_novel.</b></p></li><li> <h5>language</h5><p>
Expand Down
2 changes: 1 addition & 1 deletion public/genre.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"></head><body><nav style="height:50px;" class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="#" class="navbar-brand">Home</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="https://github.com/Shadowys/btapi" data-toggle="tooltip" data-placement="right" title="" data-original-title="Source code here!"><i class="fa fa-github fa-2x"> </i></a></li><li><a href="https://www.baka-tsuki.org/forums/viewtopic.php?f=84&amp;t=10959" data-toggle="tooltip" data-placement="right" title="" data-original-title="Share your thoughts"><i class="fa fa-commenting fa-2x"> </i></a></li></ul><ul class="nav navbar-nav navbar-right"><li><a href="#">Top</a></li></ul></div></div></nav><div id="toc"><p>Table of Contents</p><ul><li> <a href="#GS">Genre Search</a></li><li> <a href="#Example">JSON example</a></li></ul></div><h3 id="GS">Genre Search</h3><h5>route: "/api/genre"</h5><h5>return: JSON</h5><h5>format: /api/genre?list={list_of_genres}</h5><br><h4> <u>Filter Parameters</u></h4><h5>By list</h5><a href="/api?list=action|romance">/api?title=Zero_no_Tsukaima </a><p>
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"></head><body><nav style="height:50px;" class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="#" class="navbar-brand">Home</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="https://github.com/Shadowys/btapi" data-toggle="tooltip" data-placement="right" title="" data-original-title="Source code here!"><i class="fa fa-github fa-2x"> </i></a></li><li><a href="https://www.baka-tsuki.org/forums/viewtopic.php?f=84&amp;t=10959" data-toggle="tooltip" data-placement="right" title="" data-original-title="Share your thoughts"><i class="fa fa-commenting fa-2x"> </i></a></li></ul><ul class="nav navbar-nav navbar-right"><li><a href="#">Top</a></li></ul></div></div></nav><div id="toc"><p>Table of Contents</p><ul><li> <a href="#GS">Genre Search</a></li><li> <a href="#Example">JSON example</a></li></ul></div><h3 id="GS">Genre Search</h3><h5>route: GET "/api/genre"</h5><h5>return: JSON</h5><h5>format: /api/genre?list={list_of_genres}</h5><br><h4> <u>Filter Parameters</u></h4><h5>By list</h5><a href="/api?list=action|romance">/api?title=Zero_no_Tsukaima </a><p>
This parameter <b>must be present </b>to continue. The values are separated by a <b>pipe ("|")</b>character. It is <b>case-insensitive.</b></p><br><h4> <u>JSON properties</u></h4><div id="Example" class="row"><div class="col-md-7"><h5>genres</h5><p>(STRING) The list of genres that have been queried.</p><h5>titles</h5><p>(LIST) JSON data of the titles.</p><ul><li> <h5>title</h5><p>(STRING) title name of the book</p></li><li> <h5>page</h5><p>(STRING) interwiki main page title of the book.</p></li><li> <h5>lastreviseddate</h5><p>(STRING) The data and time of the last revision, in UTC+0.</p></li><li> <h5>lastrevisedid</h5><p>(NUMBER) the unique id of the last revison.</p></li><li> <h5>pageid</h5><p>(NUMBER) the unique id of the main page of the book</p></li></ul></div><div class="col-md-5"><h4>
Example response using </h4><a href="/api/genre?list=shoujo|comedy"></a><code>/api/genre?list=shoujo|comedy</code><div id="json_display"></div></div></div><script src="javascripts/jquery-2.1.1.js"></script><script src="javascripts/bootstrap.min.js"></script><script src="javascripts/jquery.jsonview.js"></script><script>$(document).ready(function () {
$("[data-toggle='tooltip']").tooltip();
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"></head><body><nav style="height:50px;" class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="#" class="navbar-brand">Home</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="https://github.com/Shadowys/btapi" data-toggle="tooltip" data-placement="right" title="" data-original-title="Source code here!"><i class="fa fa-github fa-2x"> </i></a></li><li><a href="https://www.baka-tsuki.org/forums/viewtopic.php?f=84&amp;t=10959" data-toggle="tooltip" data-placement="right" title="" data-original-title="Share your thoughts"><i class="fa fa-commenting fa-2x"> </i></a></li></ul><ul class="nav navbar-nav navbar-right"><li><a href="#">Top</a></li></ul></div></div></nav><a href="https://github.com/Shadowys/btapi"><h2>Baka Tsuki API</h2></a><h5>
Welcome to the new <b>REST API </b>centre. I'm planning to cleanup the current API provided by mediawiki
so that there would be a unified API for accessing Baka Tsuki data.</h5><p>The API always returns JSON and is based on filtering.</p><br><p>Click the links below to get started</p><a href="/series.html"><h4>Light Novel Search </h4></a><a href="/category.html"><h4>Type and Language Search </h4></a><a href="/time.html"><h4>Time and Revision Search </h4></a><a href="/genre.html"><h4>Genre Search</h4></a><br><p>Help needed : documentation cleanup </p><script src="javascripts/jquery-2.1.1.js"></script><script src="javascripts/bootstrap.min.js"></script><script src="javascripts/jquery.jsonview.js"></script><script>$(document).ready(function () {
so that there would be a unified API for accessing Baka Tsuki data.</h5><p>The API always returns JSON and is based on filtering.</p><br><p>Click the links below to get started</p><a href="/series.html"><h4>Light Novel Search (GET "/api")</h4></a><a href="/category.html"><h4>Type and Language Search (GET "/api/category")</h4></a><a href="/time.html"><h4>Time and Revision Search (GET "/api/time")</h4></a><a href="/genre.html"><h4>Genre Search (GET "/api/time")</h4></a><br><p>Help needed : documentation cleanup </p><script src="javascripts/jquery-2.1.1.js"></script><script src="javascripts/bootstrap.min.js"></script><script src="javascripts/jquery.jsonview.js"></script><script>$(document).ready(function () {
$("[data-toggle='tooltip']").tooltip();
});</script></body></html>
2 changes: 1 addition & 1 deletion public/series.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"></head><body><nav style="height:50px;" class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="#" class="navbar-brand">Home</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="https://github.com/Shadowys/btapi" data-toggle="tooltip" data-placement="right" title="" data-original-title="Source code here!"><i class="fa fa-github fa-2x"> </i></a></li><li><a href="https://www.baka-tsuki.org/forums/viewtopic.php?f=84&amp;t=10959" data-toggle="tooltip" data-placement="right" title="" data-original-title="Share your thoughts"><i class="fa fa-commenting fa-2x"> </i></a></li></ul><ul class="nav navbar-nav navbar-right"><li><a href="#">Top</a></li></ul></div></div></nav><div id="toc"><p>Table of Contents</p><ul><li> <a href="#LNS">Light Novel Search</a></li><li> <a href="#Example">JSON example</a></li></ul></div><div class="wrapper"><h3 id="LNS">Light Novel Search</h3><route>"/api"</route><return><JSON></JSON></return><format>/api?title={light_novel_title}[&series={regex_of_series_name}][&volume={regex_of_volume_name}][&volumeno={volume_number}]</format><br><h4> <u>Filter Parameters</u></h4><h5>By title</h5><a href="/api?title=Zero_no_Tsukaima">/api?title=Zero_no_Tsukaima </a><p>
<!DOCTYPE html><html><head><title>Baka Tsuki API</title><link rel="stylesheet" href="/stylesheets/bootstrap.min.css"><link rel="stylesheet" href="/stylesheets/style.css"><link rel="stylesheet" href="/stylesheets/jquery.jsonview.css"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"></head><body><nav style="height:50px;" class="navbar navbar-default navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" class="navbar-toggle collapsed"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="#" class="navbar-brand">Home</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="https://github.com/Shadowys/btapi" data-toggle="tooltip" data-placement="right" title="" data-original-title="Source code here!"><i class="fa fa-github fa-2x"> </i></a></li><li><a href="https://www.baka-tsuki.org/forums/viewtopic.php?f=84&amp;t=10959" data-toggle="tooltip" data-placement="right" title="" data-original-title="Share your thoughts"><i class="fa fa-commenting fa-2x"> </i></a></li></ul><ul class="nav navbar-nav navbar-right"><li><a href="#">Top</a></li></ul></div></div></nav><div id="toc"><p>Table of Contents</p><ul><li> <a href="#LNS">Light Novel Search</a></li><li> <a href="#Example">JSON example</a></li></ul></div><div class="wrapper"><h3 id="LNS">Light Novel Search</h3><h5>route: GET "/api"</h5><h5>return: JSON</h5><h5>format: /api?title={light_novel_title}[&series={regex_of_series_name}][&volume={regex_of_volume_name}][&volumeno={volume_number}]</h5><br><h4> <u>Filter Parameters</u></h4><h5>By title</h5><a href="/api?title=Zero_no_Tsukaima">/api?title=Zero_no_Tsukaima </a><p>
This parameter <b>must be present </b>to continue.</p><h5>By series (Optional)</h5><a href="/api?title=Chrome_Shelled_Regios&amp;series=chrome|regios">/api?title=Chrome_Shelled_Regios&series=chrome|regios </a><p>
This parameter can be a <b>regex </b>of the series name. The example above uses the pipe character.</p><h5>By volume (Optional)</h5><a href="/api?title=Chrome_Shelled_Regios&amp;series=chrome&amp;volume=15|log">/api?title=Chrome_Shelled_Regios&series=chrome&volume=15|log </a><p>
This parameter can be a <b>regex </b>of the volume name, which includes the volume number. The example above uses the pipe character.</p><h5>By volume number (Optional)</h5><a href="/api?title=Chrome_Shelled_Regios&amp;series=chrome&amp;volumeno=1">/api?title=Chrome_Shelled_Regios&series=chrome&volumeno=1 </a><p>
Expand Down
Loading

0 comments on commit 35330e9

Please sign in to comment.