• Stars
    star
    52
  • Rank 541,203 (Top 11 %)
  • Language
    Go
  • License
    MIT License
  • Created about 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

xkcd.com API client in Go

go-xkcd

HTTP Client for the xkcd API.

wercker status Coverage Status GoDoc

https://xkcd.com/1481/

Details on the xkcd API can be found here.

Install

Outside a project using go modules, get the latest version by running:

go get github.com/nishanths/go-xkcd

Inside a project using go modules, use:

go get github.com/nishanths/go-xkcd/v2

Example

The following program prints details about xkcd.com/599:

package main

import (
    "context"
    "fmt"
    "log"

    "github.com/nishanths/go-xkcd/v2"
)

func main() {
    client := xkcd.NewClient()

    comic, err := client.Get(context.Background(), 599)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Printf("%s: %s\n", comic.Title, comic.ImageURL) // Apocalypse: http://imgs.xkcd.com/comics/apocalypse.png
}

Test

To run tests:

$ go test -race

Godoc

https://godoc.org/github.com/nishanths/go-xkcd

License

The MIT License. Copyright © Nishanth Shanmugham.

More Repositories

1

zoom.js

Fork of fat/zoom.js with improvements
TypeScript
1,344
star
2

license

Command line license text generator.
Go
653
star
3

cocoa-hugo-theme

Responsive Hugo blog theme (note: not actively worked on)
CSS
325
star
4

exhaustive

Check exhaustiveness of switch statements of enum-like constants.
Go
258
star
5

lyft

Create and manage Lyft rides from the command line
Go
36
star
6

predeclared

Find declarations in Go source code that shadow predeclared identifiers
Go
27
star
7

loupe-js

Image magnifier written in TypeScript; works with touch events and supports React
TypeScript
19
star
8

slack-texts

SMS notifications for Slack groups
JavaScript
19
star
9

dedupimport

Deduplicate named and unnamed imports of the same import path in Go files
Go
18
star
10

rust-haikunator

Rust
16
star
11

YWeatherAPI

Yahoo Weather API wrapper for iOS and Mac
Objective-C
16
star
12

youtube-pause-chrome

Properly pause YouTube with spacebar
JavaScript
16
star
13

scrobble

Apple Music scrobbling with beautiful album artwork.
Go
11
star
14

what-s-playing

Firefox extension: Desktop notifications for music websites
JavaScript
7
star
15

nishanths.github.io

Website + writing with Jekyll (see source branch for old code).
SCSS
5
star
16

block-urls

Firefox WebExtension to block exact URLs
JavaScript
4
star
17

QuickCal

Chrome extension: Single-click event adding to Google Calendar
JavaScript
4
star
18

lyft-go

Go client for Lyft's v1 HTTP API
Go
3
star
19

metaimport

Generate HTML pages with <meta> tags for custom Go import paths
Go
3
star
20

print-instacart

Make a decent PDF of an Instacart order
TypeScript
2
star
21

redditgold

Gold features such as new comment highlighting
JavaScript
2
star
22

godoc-goos-goarch

Easily switch GOOS and GOARCH params on godoc.org
HTML
2
star
23

fullstory

Go client for the FullStory API
Go
1
star
24

albumday

“Album Birthdays!” app source code
Go
1
star
25

unusedargs

See instead: https://github.com/mvdan/unparam
Go
1
star
26

fmap

Generate a map[string][]byte of directory contents
Go
1
star
27

iterators.js

Iterators for node and the browser
JavaScript
1
star
28

spitfire-live

A real-time, personal lyrics assistant (winning project @HackTX 2015)
HTML
1
star
29

auto-browser

Automate the browser based on natural actions – Top 10 @HackTX 2014
JavaScript
1
star
30

impl

Find types that implement an interface
Go
1
star
31

chp

Common Go channel patterns implemented with type parameters.
Go
1
star