2018-07-01 01:58:08 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"time"
|
|
|
|
|
2019-04-23 05:45:17 +00:00
|
|
|
"github.com/akyoto/color"
|
2019-06-03 09:32:43 +00:00
|
|
|
"github.com/animenotifier/notify.moe/arn"
|
2018-07-01 01:58:08 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
color.Yellow("Marking current month as current")
|
|
|
|
|
|
|
|
defer color.Green("Finished")
|
|
|
|
defer arn.Node.Close()
|
|
|
|
|
|
|
|
now := time.Now()
|
|
|
|
currentYear := now.Year()
|
|
|
|
currentMonth := now.Month()
|
|
|
|
|
|
|
|
for anime := range arn.StreamAnime() {
|
|
|
|
animeStart := anime.StartDateTime()
|
|
|
|
|
|
|
|
if anime.Status != "current" && animeStart.Year() == currentYear && animeStart.Month() == currentMonth {
|
|
|
|
fmt.Println(anime)
|
|
|
|
anime.Status = "current"
|
|
|
|
anime.Save()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|