Added FF14 rankings

This commit is contained in:
Eduard Urbach 2018-10-31 05:34:52 +09:00
parent 000f04025b
commit bad6a17409
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,41 @@
package main
import (
"time"
"github.com/animenotifier/arn"
"github.com/animenotifier/arn/stringutils"
"github.com/fatih/color"
)
var ticker = time.NewTicker(1100 * time.Millisecond)
func main() {
color.Yellow("Refreshing FFXIV information")
defer color.Green("Finished.")
defer arn.Node.Close()
for user := range arn.StreamUsers() {
if user.Accounts.FinalFantasyXIV.Nick == "" || user.Accounts.FinalFantasyXIV.Server == "" {
continue
}
// Fetch new info
err := user.RefreshFFXIVInfo()
if err != nil {
color.Red(err.Error())
continue
}
// Log it
stringutils.PrettyPrint(user.Accounts.FinalFantasyXIV)
// Save in database
user.Save()
// Wait for rate limiter
<-ticker.C
}
}

View File

@ -22,5 +22,6 @@
margin-left 0.8rem
.ranking-score,
.ranking-accuracy
.ranking-accuracy,
.ranking-level
text-align right