2024-07-19 19:40:18 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-08-20 06:07:46 +00:00
|
|
|
"git.anthrove.art/Anthrove/e621-sdk-go/pkg/e621"
|
2024-07-19 19:40:18 +00:00
|
|
|
_ "github.com/joho/godotenv/autoload"
|
|
|
|
"log"
|
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
client := e621.NewClient(os.Getenv("API_USER"), os.Getenv("API_KEY"))
|
|
|
|
user, err := client.GetUserByName("selloo").Execute()
|
|
|
|
if err != nil {
|
|
|
|
log.Panic(err)
|
|
|
|
}
|
|
|
|
log.Printf("User ID of user %s: %d ", user.Name, user.ID)
|
|
|
|
|
|
|
|
user, err = client.GetUserByID(1337).Execute()
|
|
|
|
if err != nil {
|
|
|
|
log.Panic(err)
|
|
|
|
}
|
|
|
|
log.Printf("User Name of user with ID %d: %s ", user.ID, user.Name)
|
|
|
|
}
|