Add Future Seasons Service - v2.2.0

pull/1/head
Jéluchu 5 years ago
parent 9084d2b023
commit b7f8574851

@ -1,4 +1,4 @@
# **Aruppi API** (v2.0.0)
# **Aruppi API** (v2.2.0)
> This API has everything about Japan, from anime, music, radio, images, videos ... to japanese culture
>

@ -161,6 +161,25 @@ const allSeasons = async () =>{
};
const laterSeasons = async () =>{
const data = await html(`${BASE_JIKAN}season/later`).json();
let body = data.anime;
const promises = []
body.map(doc =>{
promises.push({
malid: doc.mal_id,
title: doc.title,
image: doc.image_url
});
});
return promises;
};
const getLastEpisodes = async () =>{
const data = await html(`${BASE_ANIMEFLV_JELU}LatestEpisodesAdded`).json();
@ -388,6 +407,7 @@ module.exports = {
getNews,
season,
allSeasons,
laterSeasons,
getLastEpisodes,
getSpecials,
getMoreInfo,

@ -7,7 +7,7 @@ router.get('/', (req, res) => {
res.json({
message: 'Aruppi API - 🎏',
author: 'Jéluchu',
version: '2.0.0',
version: '2.2.0',
credits: 'The bitch loves APIs that offers data to Aruppi App',
entries: [
{
@ -18,6 +18,7 @@ router.get('/', (req, res) => {
'News': '/api/v2/news',
'Season': '/api/v2/season/:year/:type',
'All Seasons': '/api/v2/allSeasons',
'Futures Seasons': '/api/v2/laterSeasons',
'LastEpisodes': '/api/v2/lastEpisodes',
'Movies': '/api/v2/movies/:type/:page',
'Ovas': '/api/v2/ovas/:type/:page',

@ -139,6 +139,23 @@ router.get('/allSeasons' , (req, res) =>{
});
router.get('/laterSeasons' , (req, res) =>{
api.laterSeasons()
.then(archive =>{
if (archive.length > 0) {
res.status(200).json({
archive
});
} else (
res.status(500).json({ message: 'Aruppi lost in the shell'})
)
}).catch((err) =>{
console.error(err);
});
});
router.get('/lastEpisodes' , (req, res) =>{
api.getLastEpisodes()

Loading…
Cancel
Save