54 lines
1.2 KiB
Go
54 lines
1.2 KiB
Go
package users
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/aerogo/aero"
|
|
"github.com/animenotifier/arn"
|
|
"github.com/animenotifier/notify.moe/components"
|
|
)
|
|
|
|
// Active ...
|
|
func Active(ctx *aero.Context) string {
|
|
users, err := arn.GetListOfUsersCached("active users")
|
|
|
|
if err != nil {
|
|
return ctx.Error(http.StatusInternalServerError, "Could not fetch user data", err)
|
|
}
|
|
|
|
return ctx.HTML(components.Users(users))
|
|
}
|
|
|
|
// Osu ...
|
|
func Osu(ctx *aero.Context) string {
|
|
users, err := arn.GetListOfUsersCached("active osu users")
|
|
|
|
if err != nil {
|
|
return ctx.Error(http.StatusInternalServerError, "Could not fetch user data", err)
|
|
}
|
|
|
|
return ctx.HTML(components.Users(users))
|
|
}
|
|
|
|
// Staff ...
|
|
func Staff(ctx *aero.Context) string {
|
|
users, err := arn.GetListOfUsersCached("active staff users")
|
|
|
|
if err != nil {
|
|
return ctx.Error(http.StatusInternalServerError, "Could not fetch user data", err)
|
|
}
|
|
|
|
return ctx.HTML(components.Users(users))
|
|
}
|
|
|
|
// AnimeWatching ...
|
|
func AnimeWatching(ctx *aero.Context) string {
|
|
users, err := arn.GetListOfUsersCached("active anime watching users")
|
|
|
|
if err != nil {
|
|
return ctx.Error(http.StatusInternalServerError, "Could not fetch user data", err)
|
|
}
|
|
|
|
return ctx.HTML(components.Users(users))
|
|
}
|