This commit is contained in:
eson 2018-12-20 03:49:05 +08:00
parent 9c5c58295a
commit 4f3932b86b

View File

@ -49,11 +49,12 @@ func (tt *Toutiao) ToDoParser(adstring string) (string, error) {
data = strings.Trim(data, "\"") data = strings.Trim(data, "\"")
unq, _ := strconv.Unquote("\"" + data + "\"") unq, _ := strconv.Unquote("\"" + data + "\"")
data = unq data = unq
unq, _ = strconv.Unquote("\"" + data + "\"")
data = unq result := gjson.Parse(data)
var gv interface{} log.Println(result.String())
gjson.Unmarshal([]byte(data), &gv) if result.Get("app").Exists() {
spew.Dump(gv) log.Println("this is app")
}
var v interface{} var v interface{}
json.Unmarshal([]byte(data), &v) json.Unmarshal([]byte(data), &v)