Skip to content
Snippets Groups Projects
Commit def79f13 authored by Martin Schmollinger's avatar Martin Schmollinger
Browse files

Updated Joke API

parent 8d4962c9
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ import (
)
const (
url = "http://api.icndb.com/jokes/random"
url = "https://api.chucknorris.io/jokes/random"
)
func main() {
......@@ -23,5 +23,5 @@ func main() {
if err != nil {
log.Fatalf("Bad response\n:#%v", err)
}
log.Printf("Joke of the Day:\n%s", jokeResponse.Value.Joke)
log.Printf("Joke of the Day:\n%s", jokeResponse.Value)
}
package main
type JokeResponse struct {
Type string `json:"type"`
Value Value `json:"value"`
}
type Value struct {
Id int `json:"id"`
Joke string `json:"joke"`
Id string `json:"id"`
Value string `json:"value"`
Categories []string `json:"categories"`
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment