This commit is contained in:
eson 2018-12-20 03:27:01 +08:00
parent 875c665542
commit 1f49dc7987

View File

@ -4,7 +4,6 @@ import (
"encoding/json" "encoding/json"
"log" "log"
"regexp" "regexp"
"strconv"
"strings" "strings"
"testing" "testing"
@ -44,23 +43,9 @@ func (tt *Toutiao) ToDoParser(adstring string) (string, error) {
for _, data := range adlist { for _, data := range adlist {
data = strings.Trim(data, "\"") data = strings.Trim(data, "\"")
unq, err := strconv.Unquote(data) var v interface{}
json.Unmarshal([]byte(data), &v)
if err != nil { spew.Dump(v)
log.Println(err)
} else {
unq, err = strconv.Unquote(unq)
if err != nil {
log.Println(err)
} else {
data = unq
}
}
log.Println(data)
data = strings.Replace(data, "\\", "", -1)
log.Println(data)
regexp.Compile(``) regexp.Compile(``)
} }