2017-11-01 20:12:38 +01:00

33 lines
559 B
Go

package main
import (
"fmt"
"time"
"github.com/animenotifier/arn"
"github.com/fatih/color"
)
func main() {
color.Yellow("Refreshing anime characters...")
defer arn.Node.Close()
allAnime, _ := arn.AllAnime()
rateLimiter := time.NewTicker(500 * time.Millisecond)
for _, anime := range allAnime {
<-rateLimiter.C
chars, err := anime.RefreshAnimeCharacters()
if err != nil {
color.Red(err.Error())
continue
}
fmt.Printf("%s %s (%d characters)\n", anime.ID, anime.Title.Canonical, len(chars.Items))
}
color.Green("Finished.")
}