Skip to content

saadullahsaeed/go-icndb

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

go-icndb

Build Status GoDoc

GoLang client for the Internet Chuck Norris Database API (http://www.icndb.com/api/).

Usage

Get a Random Joke

package main

import (
	"fmt"
	"log"

	"github.com/saadullahsaeed/go-icndb"
)

func main() {
	joke, err := chucknorris.GetRandomJoke(nil)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("\nID: %d ", joke.ID)
	fmt.Printf("\nText: %s", joke)
}

Specify Custom Name for the Joke

  req := &chucknorris.CNDBRequest{
    FirstName: "John",
    LastName: "Doe",
  }
  joke, err := chucknorris.GetRandomJoke(req)
  if err != nil {
  	log.Fatal(err)
  }
  fmt.Printf("\nJoke: %s", joke)

About

GoLang client for the Internet Chuck Norris Database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages