Skip to content

Xe/derpigo

Repository files navigation

derpigo

API Docs License

Installation

$ go get -u github.com/Xe/derpigo

Usage Example

package main

import (
    "context"
    "os"

    "within.website/derpigo"
)

func main() {
    ctx, cancel := context.WithCancel(context.Background())
    defer cancel()

    c := derpigo.New(derpigo.WithAPIKey(os.Getenv("DERPI_API_KEY")))

    const imgID = 1330414 // https://derpibooru.org/1330414

    img, interactions, err := c.GetImage(ctx, imgID)
    if err != nil {
        log.Fatal(err)
    }

    log.Printf("%#v", img)
    log.Printf("#%v", interactions)
}