for test
This commit is contained in:
parent
f63878ff71
commit
e5ef67bb47
|
@ -43,16 +43,17 @@ func (tt *Toutiao) ToDoParser(adstring string) (presult string, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, data := range adlist {
|
for _, data := range adlist {
|
||||||
|
label := data[0:10]
|
||||||
log.Println("test json -----------------------")
|
log.Println("test json -----------------------")
|
||||||
var v interface{}
|
var v interface{}
|
||||||
|
|
||||||
// log.Println(gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Get("app").Exists())
|
log.Println(label, gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Get("app").Exists())
|
||||||
|
|
||||||
data = strings.Trim(data, "\"")
|
data = strings.Trim(data, "\"")
|
||||||
unq, _ := strconv.Unquote("\"" + data + "\"")
|
unq, _ := strconv.Unquote("\"" + data + "\"")
|
||||||
log.Println(gjson.Parse(data).Get("app").Exists())
|
log.Println(label, gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Get("app").Exists())
|
||||||
data = unq
|
data = unq
|
||||||
log.Println(gjson.Parse(data).Get("app").Exists())
|
log.Println(label, gjson.Unmarshal([]byte(data), &v), gjson.Parse(data).Get("app").Exists())
|
||||||
|
|
||||||
result := gjson.Parse(data)
|
result := gjson.Parse(data)
|
||||||
// log.Println(result.String())
|
// log.Println(result.String())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user