2016-11-23 12:44:28 +09:00

30 lines
524 B
Go

package airing
import (
"sort"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
// Get ...
func Get(ctx *aero.Context) string {
var animeList []*arn.Anime
scan := make(chan *arn.Anime)
arn.Scan("Anime", scan)
for anime := range scan {
if anime.AiringStatus != "currently airing" || anime.Adult {
continue
}
animeList = append(animeList, anime)
}
sort.Sort(arn.AnimeByPopularity(animeList))
return ctx.HTML(components.Airing(animeList))
}