34 lines
638 B
Go
Raw Normal View History

2017-07-01 16:33:20 +00:00
package main
import (
2017-07-09 13:56:40 +00:00
"github.com/animenotifier/anilist"
2017-07-01 16:33:20 +00:00
"github.com/animenotifier/arn"
2017-07-01 19:29:33 +00:00
"github.com/fatih/color"
2017-07-01 16:33:20 +00:00
)
func main() {
2017-07-09 13:56:40 +00:00
arn.PanicOnError(anilist.Authorize())
color.Green(anilist.AccessToken)
2017-07-01 19:29:33 +00:00
2017-07-01 23:44:10 +00:00
allAnime, err := arn.AllAnime()
2017-07-01 19:29:33 +00:00
arn.PanicOnError(err)
2017-07-01 23:44:10 +00:00
count := 0
2017-07-09 13:56:40 +00:00
stream := anilist.StreamAnime()
2017-07-01 19:29:33 +00:00
2017-07-01 23:44:10 +00:00
for aniListAnime := range stream {
2017-10-02 13:12:17 +00:00
println(aniListAnime.TitleRomaji)
2017-07-01 23:44:10 +00:00
anime := arn.FindAniListAnime(aniListAnime, allAnime)
2017-07-01 19:29:33 +00:00
2017-10-02 13:12:17 +00:00
if anime != nil {
color.Green("%s %s", anime.ID, aniListAnime.TitleRomaji)
count++
} else {
color.Red("Not found")
2017-07-01 19:29:33 +00:00
}
}
2017-10-02 13:12:17 +00:00
color.Green("%d anime are connected with AniList", count)
2017-07-01 16:33:20 +00:00
}