41 lines
793 B
Go
41 lines
793 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"git.dragse.it/anthrove/e621-to-graph/pkg/e621/endpoints"
|
||
|
"git.dragse.it/anthrove/e621-to-graph/pkg/e621/model"
|
||
|
"log"
|
||
|
"net/http"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
requestContext := model.RequestContext{
|
||
|
Host: "https://e621.net",
|
||
|
UserAgent: "Go-e621-SDK (@username)",
|
||
|
Username: "",
|
||
|
APIKey: "",
|
||
|
}
|
||
|
|
||
|
log.Println("Getting single pool: ")
|
||
|
client := http.Client{}
|
||
|
pool, err := endpoints.GetPool(client, requestContext, "36957")
|
||
|
|
||
|
if err != nil {
|
||
|
log.Println(err)
|
||
|
}
|
||
|
log.Println(pool.Name)
|
||
|
log.Println("----------")
|
||
|
|
||
|
log.Println("Getting list of pools: ")
|
||
|
query := map[string]string{
|
||
|
"limit": "5",
|
||
|
}
|
||
|
pools, err := endpoints.GetPools(client, requestContext, query)
|
||
|
|
||
|
if err != nil {
|
||
|
log.Println(err)
|
||
|
}
|
||
|
log.Println(len(pools))
|
||
|
log.Println("----------")
|
||
|
|
||
|
}
|