You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
1 year ago | |
---|---|---|
cmd/xkcd | 1 year ago | |
.gitignore | 1 year ago | |
LICENSE | 1 year ago | |
Makefile | 1 year ago | |
README.md | 1 year ago | |
client.go | 1 year ago | |
go.mod | 1 year ago | |
xkcd.go | 1 year ago | |
xkcd_test.go | 1 year ago |
README.md
XKCD
An XKCD API and CLI.
You can find the API information on the about page near the bottom.
Library
package main
import (
"context"
"gitea.com/jolheiser/xkcd"
)
func main() {
client := xkcd.New()
comic, err := client.Current(context.Background())
if err != nil {
panic(err)
}
// Do stuff...
}
CLI
Build the CLI if you think it's useful.
If no comic number is given, it grabs the current comic.
./xkcd [--image] [--out=<path>] [<comic>]
--image
- Get the image from the returned image URL. Pipe it wherever you want, or...--out <path>
- A path to a file to store the response (or image)