MCPcopy Create free account
hub / github.com/codingo/bbr / getJoke

Function getJoke

bbr.go:44–59  ·  view source on GitHub ↗

getJoke gets joke from https://official-joke-api.appspot.com/random_joke

(joke *Joke)

Source from the content-addressed store, hash-verified

42// getJoke gets joke from https://official-joke-api.appspot.com/random_joke
43
44func getJoke(joke *Joke) error {
45 res, err := http.Get("https://official-joke-api.appspot.com/random_joke")
46
47 if err != nil {
48 return err
49 }
50
51 body, err := ioutil.ReadAll(res.Body)
52
53 if err != nil {
54 return err
55 }
56
57 json.Unmarshal(body, &joke)
58 return nil
59}
60
61// getWayBackURL gets url from https://archive.org/wayback/available?url=%target%
62func getWayBackURL() ([]byte, error) {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected