Improved season link tool

This commit is contained in:
Eduard Urbach 2018-03-08 00:12:22 +01:00
parent 8180b59e92
commit e7426a3e7f

View File

@ -2,16 +2,27 @@ package main
import (
"fmt"
"sort"
"github.com/animenotifier/arn"
)
func main() {
list := []*arn.Anime{}
for anime := range arn.StreamAnime() {
if anime.NSFW == 1 || anime.Status != "current" || anime.StartDate == "" || anime.StartDate < "2017-09" || anime.StartDate > "2017-10-17" {
if anime.NSFW == 1 || anime.Status != "current" || anime.Type != "tv" || anime.StartDate == "" || anime.StartDate < "2017-12" || anime.StartDate > "2018-02-01" {
continue
}
list = append(list, anime)
}
sort.Slice(list, func(i, j int) bool {
return list[i].Popularity.Total() > list[j].Popularity.Total()
})
for _, anime := range list {
fmt.Printf("* [%s](/anime/%s)\n", anime.Title.Canonical, anime.ID)
}
}