blob: c7ee79d4114127d56bddfb806d0cc0517ce59a16 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package bing
import (
"time"
"framagit.org/andinus/cetus/pkg/cetus"
)
// GetBpodJson returns json response received from the api
func GetBpodJson(reqInfo map[string]string, t time.Duration) (string, error) {
params := make(map[string]string)
params["format"] = "js"
params["n"] = "1"
// if random is true then fetch 7 photos
if reqInfo["random"] == "true" {
params["n"] = "7"
}
body, err := cetus.GetRes(reqInfo["api"], params, t)
return string(body), err
}
|