Removed games integration

This commit is contained in:
2021-11-20 21:26:51 +09:00
parent 9368689019
commit 0a41069e4a
21 changed files with 3 additions and 512 deletions

View File

@ -1,33 +0,0 @@
package main
import (
"fmt"
"time"
"github.com/akyoto/color"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/notify.moe/arn/stringutils"
)
var tickerFFXIV = time.NewTicker(1100 * time.Millisecond)
func ffxiv(user *arn.User) {
fmt.Println("[FFXIV]", user.Nick, user.Accounts.FinalFantasyXIV.Nick, user.Accounts.FinalFantasyXIV.Server)
// Fetch new info
err := user.RefreshFFXIVInfo()
if err != nil {
color.Red(err.Error())
return
}
// Log it
stringutils.PrettyPrint(user.Accounts.FinalFantasyXIV)
// Save in database
user.Save()
// Wait for rate limiter
<-tickerFFXIV.C
}

View File

@ -1,33 +0,0 @@
package main
import (
"fmt"
"time"
"github.com/akyoto/color"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/notify.moe/arn/stringutils"
)
var tickerOsu = time.NewTicker(500 * time.Millisecond)
func osu(user *arn.User) {
fmt.Println("[Osu]", user.Nick, user.Accounts.Osu.Nick)
// Fetch new info
err := user.RefreshOsuInfo()
if err != nil {
color.Red(err.Error())
return
}
// Log it
stringutils.PrettyPrint(user.Accounts.Osu)
// Save in database
user.Save()
// Wait for rate limiter
<-tickerOsu.C
}

View File

@ -1,33 +0,0 @@
package main
import (
"fmt"
"time"
"github.com/akyoto/color"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/notify.moe/arn/stringutils"
)
var tickerOW = time.NewTicker(1100 * time.Millisecond)
func overwatch(user *arn.User) {
fmt.Println("[Overwatch]", user.Nick, user.Accounts.Overwatch.BattleTag)
// Fetch new info
err := user.RefreshOverwatchInfo()
if err != nil {
color.Red(err.Error())
return
}
// Log it
stringutils.PrettyPrint(user.Accounts.Overwatch)
// Save in database
user.Save()
// Wait for rate limiter
<-tickerOW.C
}

View File

@ -1,27 +0,0 @@
package main
import (
"github.com/akyoto/color"
"github.com/animenotifier/notify.moe/arn"
)
func main() {
color.Yellow("Refreshing game information")
defer color.Green("Finished.")
defer arn.Node.Close()
for user := range arn.StreamUsers() {
if user.Accounts.Osu.Nick != "" {
osu(user)
}
if user.Accounts.Overwatch.BattleTag != "" {
overwatch(user)
}
if user.Accounts.FinalFantasyXIV.Nick != "" && user.Accounts.FinalFantasyXIV.Server != "" {
ffxiv(user)
}
}
}