This commit is contained in:
huangsimin 2018-12-20 10:32:56 +08:00
parent 310fcb9fac
commit f550fff92a

View File

@ -43,13 +43,13 @@ func (tt *Toutiao) ToDoParser(adstring string) (string, error) {
for _, data := range adlist {
var v interface{}
log.Println(gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Exists())
log.Println(gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Get("app").Exists())
data = strings.Trim(data, "\"")
unq, _ := strconv.Unquote("\"" + data + "\"")
log.Println(gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Exists())
log.Println(gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Get("app").Exists())
data = unq
log.Println(gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Exists())
log.Println(gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Get("app").Exists())
result := gjson.Parse(data)
log.Println(result.String())