Asis Documentation
This is the documentation for the AG ASIS
now available to public use.
Table of contents
Overview
Asis, an anagram that stands for Anime Series Image Servlet,
is a servlet that uses shows images based on requests.
topWhy? What use is that?
Asis allows programmers, designers, webmasters.. ect to have an easily obtainable resource of thumbnailed to full sized images for
popular, and common series. Allowing you to utilise more space on your server for your other needs or wants. Also, saving you time
from having to create images, or making that extra panel on your site for users to add images. It's already done, and its Asis.
Asis Api
top
HTTP
topParsing
top
http://serve.anigaiku.com/34/soul_eater view?
If the series does not exist you will receive the 903 error code.
top
topSeries
- Series name to lowercase
- Replace all characters except spaces, alphanumericals
- Replace multiple spaces if needed.
- Trim ending spaces
- Replace spaces with underscores
http://serve.anigaiku.com/34/soul_eater view?
If the series does not exist you will receive the 903 error code.
top
Methods
top
Function
Example of creating image with asis function:
PHP
// Series
$series = strtolower($_POST['series']);
$series = preg_replace('/[^a-z0-9\ ]/', '', $series);
$series = preg_replace("/(\s)+/", " ", $series);
$series = trim($series);
$series = str_replace(' ', '_', $series);
Shown above is a simple way to parse a normal series title like: Soul Eater into
soul_eater fully compatable with asis.
Function
function asis($size, $series, $square = false) {
$series = strtolower($series);
$series = preg_replace('/[^a-z0-9\ ]/', '', $series);
$series = preg_replace("/(\s)+/", " ", $series);
$series = trim($series);
$series = str_replace(' ', '_', $series);
// Squaring
if($square)
{
$size = $size.'s';
}
return 'http://serve.anigaiku.com/'.$size.'/'.$series;
}
The function above takes the php method and asks for what size, and if you want to square it. Not to be used with
user submitted variables. Example of use:
<?php echo asis('34', 'Soul Eater'); ?>
Using just the function would output a url like so: http://serve.anigaiku.com/34/soul_eater
Example of creating image with asis function:
<img src="<?php echo asis('34', 'Soul Eater'); ?>" alt="Soul Eater Image" />
Sizing
Images can be served 9 different ways through the api, all of them allowing for multiple uses.
top- 34 - ratio parsed 34 x *, smallest size
- 34s - square cube 34 x 34, smallest size
- 64 - ratio parsed 64 x *, thumbnail size
- 64s - square cube 64 x 64, thumbnail size
- 126 - ratio parsed 126 x *, medium size
- 126s - square cube 126 x 126, medium size
- 252 - ratio parsed 252 x *, large size
- 500 - ratio parsed 500 x *, mega size
- 000 - ???, default image
Error Responses
902 - Series contains invalid characters 903 - Invalid series 904 - Invalid image size 905 - Open for future use 906 - Rate limit reached for x size 907 - Rate limit abuse reached